@elastic/eui 93.2.0 → 93.3.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 (189) hide show
  1. package/dist/eui_theme_dark.css +3 -0
  2. package/dist/eui_theme_dark.min.css +1 -1
  3. package/dist/eui_theme_light.css +3 -0
  4. package/dist/eui_theme_light.min.css +1 -1
  5. package/es/components/breadcrumbs/breadcrumb.js +9 -6
  6. package/es/components/breadcrumbs/breadcrumbs.js +4 -2
  7. package/es/components/button/button_display/_button_display.js +2 -3
  8. package/es/components/button/button_empty/button_empty.js +2 -3
  9. package/es/components/button/button_group/button_group.js +3 -5
  10. package/es/components/button/button_group/button_group.styles.js +10 -13
  11. package/es/components/button/button_icon/button_icon.js +4 -5
  12. package/es/components/button/button_icon/button_icon.styles.js +11 -3
  13. package/es/components/datagrid/body/cell/data_grid_cell.js +7 -3
  14. package/es/components/datagrid/body/cell/data_grid_cell_wrapper.js +4 -2
  15. package/es/components/datagrid/body/data_grid_body.js +1 -0
  16. package/es/components/datagrid/body/data_grid_body_custom.js +3 -0
  17. package/es/components/datagrid/body/data_grid_body_virtualized.js +3 -0
  18. package/es/components/datagrid/body/data_grid_row_manager.js +1 -1
  19. package/es/components/datagrid/data_grid.js +3 -1
  20. package/es/components/facet/facet_button.styles.js +1 -2
  21. package/es/components/header/header_breadcrumbs/header_breadcrumbs.js +4 -2
  22. package/es/components/icon/icon.js +13 -16
  23. package/es/components/icon/icon.styles.js +6 -9
  24. package/es/components/link/external_link_icon.js +11 -8
  25. package/es/components/link/link.js +2 -3
  26. package/es/components/link/link.styles.js +4 -10
  27. package/es/components/page/page_header/page_header_content.js +4 -2
  28. package/es/components/progress/progress.styles.js +2 -2
  29. package/es/components/skeleton/skeleton_circle.js +2 -3
  30. package/es/components/skeleton/skeleton_rectangle.js +2 -3
  31. package/es/components/skeleton/skeleton_text.js +16 -12
  32. package/es/components/skeleton/skeleton_title.js +2 -3
  33. package/es/components/text/text.js +2 -3
  34. package/es/components/text/text_align.js +1 -2
  35. package/es/components/text/text_align.styles.js +5 -7
  36. package/es/components/text/text_color.js +2 -3
  37. package/es/components/title/title.js +2 -3
  38. package/es/components/title/title.styles.js +0 -7
  39. package/es/global_styling/mixins/_typography.js +17 -6
  40. package/es/services/theme/index.js +1 -1
  41. package/es/services/theme/style_memoization.js +47 -14
  42. package/es/themes/amsterdam/global_styling/mixins/button.js +47 -24
  43. package/eui.d.ts +46 -37
  44. package/i18ntokens.json +36 -36
  45. package/lib/components/breadcrumbs/breadcrumb.js +9 -6
  46. package/lib/components/breadcrumbs/breadcrumbs.js +4 -2
  47. package/lib/components/button/button_display/_button_display.js +1 -2
  48. package/lib/components/button/button_empty/button_empty.js +1 -2
  49. package/lib/components/button/button_group/button_group.js +2 -4
  50. package/lib/components/button/button_group/button_group.styles.js +10 -13
  51. package/lib/components/button/button_icon/button_icon.js +3 -4
  52. package/lib/components/button/button_icon/button_icon.styles.js +10 -2
  53. package/lib/components/datagrid/body/cell/data_grid_cell.js +7 -3
  54. package/lib/components/datagrid/body/cell/data_grid_cell_wrapper.js +4 -2
  55. package/lib/components/datagrid/body/data_grid_body.js +1 -0
  56. package/lib/components/datagrid/body/data_grid_body_custom.js +3 -0
  57. package/lib/components/datagrid/body/data_grid_body_virtualized.js +3 -0
  58. package/lib/components/datagrid/body/data_grid_row_manager.js +1 -1
  59. package/lib/components/datagrid/data_grid.js +3 -1
  60. package/lib/components/facet/facet_button.styles.js +1 -2
  61. package/lib/components/header/header_breadcrumbs/header_breadcrumbs.js +4 -2
  62. package/lib/components/icon/icon.js +12 -15
  63. package/lib/components/icon/icon.styles.js +5 -8
  64. package/lib/components/link/external_link_icon.js +10 -7
  65. package/lib/components/link/link.js +1 -2
  66. package/lib/components/link/link.styles.js +6 -14
  67. package/lib/components/page/page_header/page_header_content.js +4 -2
  68. package/lib/components/progress/progress.styles.js +1 -1
  69. package/lib/components/skeleton/skeleton_circle.js +1 -2
  70. package/lib/components/skeleton/skeleton_rectangle.js +1 -2
  71. package/lib/components/skeleton/skeleton_text.js +18 -11
  72. package/lib/components/skeleton/skeleton_title.js +1 -2
  73. package/lib/components/text/text.js +1 -2
  74. package/lib/components/text/text_align.js +1 -2
  75. package/lib/components/text/text_align.styles.js +5 -7
  76. package/lib/components/text/text_color.js +1 -2
  77. package/lib/components/title/title.js +1 -2
  78. package/lib/components/title/title.styles.js +2 -10
  79. package/lib/global_styling/mixins/_typography.js +27 -19
  80. package/lib/services/theme/index.js +6 -0
  81. package/lib/services/theme/style_memoization.js +49 -16
  82. package/lib/themes/amsterdam/global_styling/mixins/button.js +49 -25
  83. package/optimize/es/components/breadcrumbs/breadcrumb.js +5 -4
  84. package/optimize/es/components/button/button_display/_button_display.js +2 -3
  85. package/optimize/es/components/button/button_empty/button_empty.js +2 -3
  86. package/optimize/es/components/button/button_group/button_group.js +3 -5
  87. package/optimize/es/components/button/button_group/button_group.styles.js +10 -13
  88. package/optimize/es/components/button/button_icon/button_icon.js +4 -5
  89. package/optimize/es/components/button/button_icon/button_icon.styles.js +8 -3
  90. package/optimize/es/components/datagrid/body/cell/data_grid_cell.js +5 -3
  91. package/optimize/es/components/datagrid/body/cell/data_grid_cell_wrapper.js +4 -2
  92. package/optimize/es/components/datagrid/body/data_grid_body_custom.js +2 -0
  93. package/optimize/es/components/datagrid/body/data_grid_body_virtualized.js +2 -0
  94. package/optimize/es/components/datagrid/body/data_grid_row_manager.js +1 -1
  95. package/optimize/es/components/datagrid/data_grid.js +3 -1
  96. package/optimize/es/components/facet/facet_button.styles.js +1 -2
  97. package/optimize/es/components/icon/icon.js +13 -16
  98. package/optimize/es/components/icon/icon.styles.js +6 -9
  99. package/optimize/es/components/link/external_link_icon.js +11 -8
  100. package/optimize/es/components/link/link.js +2 -3
  101. package/optimize/es/components/link/link.styles.js +4 -10
  102. package/optimize/es/components/progress/progress.styles.js +2 -2
  103. package/optimize/es/components/skeleton/skeleton_circle.js +2 -3
  104. package/optimize/es/components/skeleton/skeleton_rectangle.js +2 -3
  105. package/optimize/es/components/skeleton/skeleton_text.js +16 -12
  106. package/optimize/es/components/skeleton/skeleton_title.js +2 -3
  107. package/optimize/es/components/text/text.js +2 -3
  108. package/optimize/es/components/text/text_align.js +1 -2
  109. package/optimize/es/components/text/text_align.styles.js +5 -7
  110. package/optimize/es/components/text/text_color.js +2 -3
  111. package/optimize/es/components/title/title.js +2 -3
  112. package/optimize/es/components/title/title.styles.js +0 -7
  113. package/optimize/es/global_styling/mixins/_typography.js +14 -6
  114. package/optimize/es/services/theme/index.js +1 -1
  115. package/optimize/es/services/theme/style_memoization.js +47 -14
  116. package/optimize/es/themes/amsterdam/global_styling/mixins/button.js +47 -24
  117. package/optimize/lib/components/breadcrumbs/breadcrumb.js +5 -4
  118. package/optimize/lib/components/button/button_display/_button_display.js +1 -2
  119. package/optimize/lib/components/button/button_empty/button_empty.js +1 -2
  120. package/optimize/lib/components/button/button_group/button_group.js +2 -4
  121. package/optimize/lib/components/button/button_group/button_group.styles.js +10 -13
  122. package/optimize/lib/components/button/button_icon/button_icon.js +3 -4
  123. package/optimize/lib/components/button/button_icon/button_icon.styles.js +8 -2
  124. package/optimize/lib/components/datagrid/body/cell/data_grid_cell.js +5 -3
  125. package/optimize/lib/components/datagrid/body/cell/data_grid_cell_wrapper.js +4 -2
  126. package/optimize/lib/components/datagrid/body/data_grid_body_custom.js +2 -0
  127. package/optimize/lib/components/datagrid/body/data_grid_body_virtualized.js +2 -0
  128. package/optimize/lib/components/datagrid/body/data_grid_row_manager.js +1 -1
  129. package/optimize/lib/components/datagrid/data_grid.js +3 -1
  130. package/optimize/lib/components/facet/facet_button.styles.js +1 -2
  131. package/optimize/lib/components/icon/icon.js +12 -15
  132. package/optimize/lib/components/icon/icon.styles.js +5 -8
  133. package/optimize/lib/components/link/external_link_icon.js +10 -7
  134. package/optimize/lib/components/link/link.js +1 -2
  135. package/optimize/lib/components/link/link.styles.js +6 -14
  136. package/optimize/lib/components/progress/progress.styles.js +1 -1
  137. package/optimize/lib/components/skeleton/skeleton_circle.js +1 -2
  138. package/optimize/lib/components/skeleton/skeleton_rectangle.js +1 -2
  139. package/optimize/lib/components/skeleton/skeleton_text.js +18 -11
  140. package/optimize/lib/components/skeleton/skeleton_title.js +1 -2
  141. package/optimize/lib/components/text/text.js +1 -2
  142. package/optimize/lib/components/text/text_align.js +1 -2
  143. package/optimize/lib/components/text/text_align.styles.js +5 -7
  144. package/optimize/lib/components/text/text_color.js +1 -2
  145. package/optimize/lib/components/title/title.js +1 -2
  146. package/optimize/lib/components/title/title.styles.js +2 -10
  147. package/optimize/lib/global_styling/mixins/_typography.js +25 -19
  148. package/optimize/lib/services/theme/index.js +6 -0
  149. package/optimize/lib/services/theme/style_memoization.js +49 -16
  150. package/optimize/lib/themes/amsterdam/global_styling/mixins/button.js +49 -26
  151. package/package.json +3 -3
  152. package/src/components/datagrid/_data_grid_data_row.scss +4 -0
  153. package/test-env/components/breadcrumbs/breadcrumb.js +9 -6
  154. package/test-env/components/breadcrumbs/breadcrumbs.js +4 -2
  155. package/test-env/components/button/button_display/_button_display.js +1 -2
  156. package/test-env/components/button/button_empty/button_empty.js +1 -2
  157. package/test-env/components/button/button_group/button_group.js +2 -4
  158. package/test-env/components/button/button_group/button_group.styles.js +10 -13
  159. package/test-env/components/button/button_icon/button_icon.js +3 -4
  160. package/test-env/components/button/button_icon/button_icon.styles.js +8 -2
  161. package/test-env/components/datagrid/body/cell/data_grid_cell.js +7 -3
  162. package/test-env/components/datagrid/body/cell/data_grid_cell_wrapper.js +4 -2
  163. package/test-env/components/datagrid/body/data_grid_body.js +1 -0
  164. package/test-env/components/datagrid/body/data_grid_body_custom.js +3 -0
  165. package/test-env/components/datagrid/body/data_grid_body_virtualized.js +3 -0
  166. package/test-env/components/datagrid/body/data_grid_row_manager.js +1 -1
  167. package/test-env/components/datagrid/data_grid.js +3 -1
  168. package/test-env/components/facet/facet_button.styles.js +1 -2
  169. package/test-env/components/header/header_breadcrumbs/header_breadcrumbs.js +4 -2
  170. package/test-env/components/icon/icon.styles.js +5 -8
  171. package/test-env/components/link/external_link_icon.js +10 -7
  172. package/test-env/components/link/link.js +1 -2
  173. package/test-env/components/link/link.styles.js +6 -14
  174. package/test-env/components/page/page_header/page_header_content.js +4 -2
  175. package/test-env/components/progress/progress.styles.js +1 -1
  176. package/test-env/components/skeleton/skeleton_circle.js +1 -2
  177. package/test-env/components/skeleton/skeleton_rectangle.js +1 -2
  178. package/test-env/components/skeleton/skeleton_text.js +18 -11
  179. package/test-env/components/skeleton/skeleton_title.js +1 -2
  180. package/test-env/components/text/text.js +1 -2
  181. package/test-env/components/text/text_align.js +1 -2
  182. package/test-env/components/text/text_align.styles.js +5 -7
  183. package/test-env/components/text/text_color.js +1 -2
  184. package/test-env/components/title/title.js +1 -2
  185. package/test-env/components/title/title.styles.js +2 -10
  186. package/test-env/global_styling/mixins/_typography.js +25 -19
  187. package/test-env/services/theme/index.js +6 -0
  188. package/test-env/services/theme/style_memoization.js +49 -16
  189. package/test-env/themes/amsterdam/global_styling/mixins/button.js +49 -26
@@ -20,7 +20,7 @@ var _data_grid_cell_actions = require("./data_grid_cell_actions");
20
20
  var _data_grid_cell_popover = require("./data_grid_cell_popover");
21
21
  var _focus_utils = require("./focus_utils");
22
22
  var _react2 = require("@emotion/react");
23
- var _excluded = ["renderCellValue", "column", "setCellContentsRef", "rowIndex", "colIndex", "ariaRowIndex", "rowHeight", "rowHeightUtils", "isControlColumn", "isFocused", "cellActions"],
23
+ var _excluded = ["renderCellValue", "cellContext", "column", "setCellContentsRef", "rowIndex", "colIndex", "ariaRowIndex", "rowHeight", "rowHeightUtils", "isControlColumn", "isFocused", "cellActions"],
24
24
  _excluded2 = ["width", "popoverContext", "interactiveCellId", "columnType", "className", "column", "style", "rowHeightUtils", "rowHeightsOptions", "rowManager", "pagination"],
25
25
  _excluded3 = ["isExpandable", "style", "className", "data-test-subj"];
26
26
  /*
@@ -53,6 +53,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
53
53
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
54
54
  var EuiDataGridCellContent = /*#__PURE__*/(0, _react.memo)(function (_ref) {
55
55
  var renderCellValue = _ref.renderCellValue,
56
+ cellContext = _ref.cellContext,
56
57
  column = _ref.column,
57
58
  setCellContentsRef = _ref.setCellContentsRef,
58
59
  rowIndex = _ref.rowIndex,
@@ -81,7 +82,7 @@ var EuiDataGridCellContent = /*#__PURE__*/(0, _react.memo)(function (_ref) {
81
82
  rowIndex: rowIndex,
82
83
  colIndex: colIndex,
83
84
  schema: (column === null || column === void 0 ? void 0 : column.schema) || rest.columnType
84
- }, rest)));
85
+ }, cellContext, rest)));
85
86
  if (cellHeightType === 'lineCount' && !isControlColumn) {
86
87
  var lines = rowHeightUtils.getLineCount(rowHeight);
87
88
  cellContent = (0, _react2.jsx)(_text_truncate.EuiTextBlockTruncate, {
@@ -537,6 +538,7 @@ EuiDataGridCellContent.propTypes = {
537
538
  isExpandable: _propTypes.default.bool.isRequired,
538
539
  className: _propTypes.default.string,
539
540
  renderCellValue: _propTypes.default.oneOfType([_propTypes.default.func.isRequired, _propTypes.default.element.isRequired]).isRequired,
541
+ cellContext: _propTypes.default.any,
540
542
  renderCellPopover: _propTypes.default.oneOfType([_propTypes.default.func.isRequired, _propTypes.default.func.isRequired]),
541
543
  setRowHeight: _propTypes.default.func,
542
544
  getRowHeight: _propTypes.default.func,
@@ -746,6 +748,7 @@ var EuiDataGridCell = /*#__PURE__*/function (_Component) {
746
748
  var _this$props5 = _this.props,
747
749
  renderCellPopover = _this$props5.renderCellPopover,
748
750
  renderCellValue = _this$props5.renderCellValue,
751
+ cellContext = _this$props5.cellContext,
749
752
  rowIndex = _this$props5.rowIndex,
750
753
  colIndex = _this$props5.colIndex,
751
754
  column = _this$props5.column,
@@ -766,7 +769,7 @@ var EuiDataGridCell = /*#__PURE__*/function (_Component) {
766
769
  })),
767
770
  DefaultCellPopover: _data_grid_cell_popover.DefaultCellPopover,
768
771
  setCellPopoverProps: setCellPopoverProps
769
- }), (0, _react2.jsx)(CellElement, _extends({}, sharedProps, {
772
+ }), (0, _react2.jsx)(CellElement, _extends({}, cellContext, sharedProps, {
770
773
  setCellProps: _this.setCellProps,
771
774
  isExpandable: true,
772
775
  isExpanded: true,
@@ -1385,6 +1388,7 @@ EuiDataGridCell.propTypes = {
1385
1388
  setCellPopoverProps: _propTypes.default.func.isRequired
1386
1389
  }).isRequired,
1387
1390
  renderCellValue: _propTypes.default.oneOfType([_propTypes.default.func.isRequired, _propTypes.default.element.isRequired]).isRequired,
1391
+ cellContext: _propTypes.default.any,
1388
1392
  renderCellPopover: _propTypes.default.oneOfType([_propTypes.default.func.isRequired, _propTypes.default.func.isRequired]),
1389
1393
  setRowHeight: _propTypes.default.func,
1390
1394
  getRowHeight: _propTypes.default.func,
@@ -11,7 +11,7 @@ var _sorting = require("../../utils/sorting");
11
11
  var _data_grid_cell_popover = require("./data_grid_cell_popover");
12
12
  var _data_grid_cell = require("./data_grid_cell");
13
13
  var _react2 = require("@emotion/react");
14
- var _excluded = ["colIndex", "visibleRowIndex", "style", "schema", "schemaDetectors", "pagination", "columns", "leadingControlColumns", "trailingControlColumns", "visibleColCount", "columnWidths", "defaultColumnWidth", "renderCellValue", "renderCellPopover", "interactiveCellId", "setRowHeight", "rowHeightsOptions", "rowHeightUtils", "rowManager"];
14
+ var _excluded = ["colIndex", "visibleRowIndex", "style", "schema", "schemaDetectors", "pagination", "columns", "leadingControlColumns", "trailingControlColumns", "visibleColCount", "columnWidths", "defaultColumnWidth", "renderCellValue", "cellContext", "renderCellPopover", "interactiveCellId", "setRowHeight", "rowHeightsOptions", "rowHeightUtils", "rowManager"];
15
15
  /*
16
16
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
17
17
  * or more contributor license agreements. Licensed under the Elastic License
@@ -47,6 +47,7 @@ var Cell = function Cell(_ref) {
47
47
  columnWidths = _ref.columnWidths,
48
48
  defaultColumnWidth = _ref.defaultColumnWidth,
49
49
  renderCellValue = _ref.renderCellValue,
50
+ cellContext = _ref.cellContext,
50
51
  renderCellPopover = _ref.renderCellPopover,
51
52
  interactiveCellId = _ref.interactiveCellId,
52
53
  setRowHeight = _ref.setRowHeight,
@@ -88,7 +89,8 @@ var Cell = function Cell(_ref) {
88
89
  setRowHeight: isFirstColumn ? setRowHeight : undefined,
89
90
  rowManager: rowManager,
90
91
  popoverContext: popoverContext,
91
- pagination: pagination
92
+ pagination: pagination,
93
+ cellContext: cellContext
92
94
  };
93
95
  if (isLeadingControlColumn) {
94
96
  var leadingColumn = leadingControlColumns[colIndex];
@@ -569,6 +569,7 @@ EuiDataGridBody.propTypes = {
569
569
  visibleRowCount: _propTypes.default.number.isRequired
570
570
  }).isRequired,
571
571
  renderCellValue: _propTypes.default.oneOfType([_propTypes.default.func.isRequired, _propTypes.default.element.isRequired]).isRequired,
572
+ cellContext: _propTypes.default.any,
572
573
  renderCellPopover: _propTypes.default.oneOfType([_propTypes.default.func.isRequired, _propTypes.default.func.isRequired]),
573
574
  renderFooterCellValue: _propTypes.default.oneOfType([_propTypes.default.func.isRequired, _propTypes.default.element.isRequired]),
574
575
  renderCustomGridBody: _propTypes.default.func,
@@ -52,6 +52,7 @@ var EuiDataGridBodyCustomRender = function EuiDataGridBodyCustomRender(_ref) {
52
52
  schemaDetectors = _ref.schemaDetectors,
53
53
  visibleRows = _ref.visibleRows,
54
54
  renderCellValue = _ref.renderCellValue,
55
+ cellContext = _ref.cellContext,
55
56
  renderCellPopover = _ref.renderCellPopover,
56
57
  renderFooterCellValue = _ref.renderFooterCellValue,
57
58
  interactiveCellId = _ref.interactiveCellId,
@@ -141,6 +142,7 @@ var EuiDataGridBodyCustomRender = function EuiDataGridBodyCustomRender(_ref) {
141
142
  columnWidths: columnWidths,
142
143
  defaultColumnWidth: defaultColumnWidth,
143
144
  renderCellValue: renderCellValue,
145
+ cellContext: cellContext,
144
146
  renderCellPopover: renderCellPopover,
145
147
  interactiveCellId: interactiveCellId,
146
148
  setRowHeight: setRowHeight,
@@ -713,6 +715,7 @@ EuiDataGridBodyCustomRender.propTypes = {
713
715
  visibleRowCount: _propTypes.default.number.isRequired
714
716
  }).isRequired,
715
717
  renderCellValue: _propTypes.default.oneOfType([_propTypes.default.func.isRequired, _propTypes.default.element.isRequired]).isRequired,
718
+ cellContext: _propTypes.default.any,
716
719
  renderCellPopover: _propTypes.default.oneOfType([_propTypes.default.func.isRequired, _propTypes.default.func.isRequired]),
717
720
  renderFooterCellValue: _propTypes.default.oneOfType([_propTypes.default.func.isRequired, _propTypes.default.element.isRequired]),
718
721
  renderCustomGridBody: _propTypes.default.func,
@@ -97,6 +97,7 @@ var EuiDataGridBodyVirtualized = function EuiDataGridBodyVirtualized(_ref3) {
97
97
  endRow = _ref3$visibleRows.endRow,
98
98
  visibleRowCount = _ref3$visibleRows.visibleRowCount,
99
99
  renderCellValue = _ref3.renderCellValue,
100
+ cellContext = _ref3.cellContext,
100
101
  renderCellPopover = _ref3.renderCellPopover,
101
102
  renderFooterCellValue = _ref3.renderFooterCellValue,
102
103
  interactiveCellId = _ref3.interactiveCellId,
@@ -298,6 +299,7 @@ var EuiDataGridBodyVirtualized = function EuiDataGridBodyVirtualized(_ref3) {
298
299
  columnWidths: columnWidths,
299
300
  defaultColumnWidth: defaultColumnWidth,
300
301
  renderCellValue: renderCellValue,
302
+ cellContext: cellContext,
301
303
  renderCellPopover: renderCellPopover,
302
304
  interactiveCellId: interactiveCellId,
303
305
  rowHeightsOptions: rowHeightsOptions,
@@ -844,6 +846,7 @@ EuiDataGridBodyVirtualized.propTypes = {
844
846
  visibleRowCount: _propTypes.default.number.isRequired
845
847
  }).isRequired,
846
848
  renderCellValue: _propTypes.default.oneOfType([_propTypes.default.func.isRequired, _propTypes.default.element.isRequired]).isRequired,
849
+ cellContext: _propTypes.default.any,
847
850
  renderCellPopover: _propTypes.default.oneOfType([_propTypes.default.func.isRequired, _propTypes.default.func.isRequired]),
848
851
  renderFooterCellValue: _propTypes.default.oneOfType([_propTypes.default.func.isRequired, _propTypes.default.element.isRequired]),
849
852
  renderCustomGridBody: _propTypes.default.func,
@@ -87,7 +87,7 @@ var useRowManager = function useRowManager(_ref) {
87
87
  if (rowClasses) {
88
88
  rowIdToElements.current.forEach(function (rowElement, rowIndex) {
89
89
  var euiClasses = Array.from(rowElement.classList).filter(function (className) {
90
- return className.startsWith('euiDataGridRow');
90
+ return ['euiDataGridRow', 'euiDataGridRow--striped'].includes(className);
91
91
  }).join(' ');
92
92
  if (rowClasses[rowIndex]) {
93
93
  rowElement.classList.value = "".concat(euiClasses, " ").concat(rowClasses[rowIndex]);
@@ -25,7 +25,7 @@ var _data_grid_schema = require("./utils/data_grid_schema");
25
25
  var _ref = require("./utils/ref");
26
26
  var _data_grid_types = require("./data_grid_types");
27
27
  var _react2 = require("@emotion/react");
28
- var _excluded = ["leadingControlColumns", "trailingControlColumns", "columns", "columnVisibility", "schemaDetectors", "rowCount", "renderCellValue", "renderCellPopover", "renderFooterCellValue", "className", "gridStyle", "toolbarVisibility", "pagination", "sorting", "inMemory", "onColumnResize", "minSizeForControls", "height", "width", "rowHeightsOptions", "virtualizationOptions", "renderCustomGridBody", "renderCustomToolbar"],
28
+ var _excluded = ["leadingControlColumns", "trailingControlColumns", "columns", "columnVisibility", "schemaDetectors", "rowCount", "renderCellValue", "cellContext", "renderCellPopover", "renderFooterCellValue", "className", "gridStyle", "toolbarVisibility", "pagination", "sorting", "inMemory", "onColumnResize", "minSizeForControls", "height", "width", "rowHeightsOptions", "virtualizationOptions", "renderCustomGridBody", "renderCustomToolbar"],
29
29
  _excluded2 = ["focusProps"];
30
30
  /*
31
31
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
@@ -95,6 +95,7 @@ var EuiDataGrid = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forward
95
95
  schemaDetectors = props.schemaDetectors,
96
96
  rowCount = props.rowCount,
97
97
  renderCellValue = props.renderCellValue,
98
+ cellContext = props.cellContext,
98
99
  renderCellPopover = props.renderCellPopover,
99
100
  renderFooterCellValue = props.renderFooterCellValue,
100
101
  className = props.className,
@@ -364,6 +365,7 @@ var EuiDataGrid = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forward
364
365
  schemaDetectors: allSchemaDetectors,
365
366
  pagination: pagination,
366
367
  renderCellValue: renderCellValue,
368
+ cellContext: cellContext,
367
369
  renderCellPopover: renderCellPopover,
368
370
  renderFooterCellValue: renderFooterCellValue,
369
371
  rowCount: rowCount,
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.euiFacetButtonTextStyles = exports.euiFacetButtonStyles = exports.euiFacetButtonQuantityStyles = exports.euiFacetButtonLoadingSpinnerStyles = exports.euiFacetButtonIconStyles = void 0;
7
7
  var _react = require("@emotion/react");
8
8
  var _global_styling = require("../../global_styling");
9
- var _link = require("../link/link.styles");
10
9
  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)."; } /*
11
10
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
12
11
  * or more contributor license agreements. Licensed under the Elastic License
@@ -18,7 +17,7 @@ var euiFacetButtonStyles = function euiFacetButtonStyles(_ref3) {
18
17
  var euiTheme = _ref3.euiTheme;
19
18
  return {
20
19
  // Base
21
- euiFacetButton: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('left'), " &:hover,&:focus{&:not(:disabled) [class*='euiFacetButton__text']{text-decoration:underline;}}&:focus:not(:disabled) [class*='euiFacetButton__text']{", (0, _link.euiLinkFocusCSS)(euiTheme), ";}&:disabled{color:", euiTheme.colors.disabledText, ";pointer-events:none;&:hover,&:focus{text-decoration:none;}};label:euiFacetButton;")
20
+ euiFacetButton: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('left'), " &:not(:disabled){&:hover,&:focus{text-decoration:none;.euiFacetButton__text{text-decoration:underline;}}&:focus .euiFacetButton__text{text-decoration-thickness:", euiTheme.border.width.thick, ";}}&:disabled{color:", euiTheme.colors.disabledText, ";pointer-events:none;};label:euiFacetButton;")
22
21
  };
23
22
  };
24
23
  exports.euiFacetButtonStyles = euiFacetButtonStyles;
@@ -95,12 +95,14 @@ EuiHeaderBreadcrumbs.propTypes = {
95
95
  */
96
96
  "aria-current": _propTypes.default.any,
97
97
  /**
98
- * Creates a breadcrumb that toggles a popover dialog
98
+ * Creates a breadcrumb that toggles a popover dialog. Takes any rendered node(s),
99
+ * or a render function that will pass callback allowing you to close the
100
+ * breadcrumb popover from within your popover content.
99
101
  *
100
102
  * If passed, both `href` and `onClick` will be ignored - the breadcrumb's
101
103
  * click behavior should only trigger a popover.
102
104
  */
103
- popoverContent: _propTypes.default.node,
105
+ popoverContent: _propTypes.default.oneOfType([_propTypes.default.node.isRequired, _propTypes.default.func.isRequired]),
104
106
  /**
105
107
  * Allows customizing the popover if necessary. Accepts any props that
106
108
  * [EuiPopover](/#/layout/popover) accepts, except for props that control state.
@@ -21,7 +21,7 @@ var _services = require("../../services");
21
21
  var _named_colors = require("./named_colors");
22
22
  var _icon = require("./icon.styles");
23
23
  var _react3 = require("@emotion/react");
24
- var _excluded = ["type", "size", "color", "className", "tabIndex", "title", "onIconLoad", "theme", "style"];
24
+ var _excluded = ["type", "size", "color", "className", "tabIndex", "title", "onIconLoad", "style", "stylesMemoizer"];
25
25
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
26
26
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
27
27
  function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
@@ -206,8 +206,8 @@ var EuiIconClass = /*#__PURE__*/function (_PureComponent) {
206
206
  tabIndex = _this$props.tabIndex,
207
207
  title = _this$props.title,
208
208
  onIconLoad = _this$props.onIconLoad,
209
- theme = _this$props.theme,
210
209
  style = _this$props.style,
210
+ stylesMemoizer = _this$props.stylesMemoizer,
211
211
  rest = _objectWithoutProperties(_this$props, _excluded);
212
212
  var _this$state = this.state,
213
213
  isLoading = _this$state.isLoading,
@@ -229,7 +229,7 @@ var EuiIconClass = /*#__PURE__*/function (_PureComponent) {
229
229
  var classes = (0, _classnames.default)('euiIcon', className);
230
230
 
231
231
  // Emotion styles
232
- var styles = (0, _icon.euiIconStyles)(theme);
232
+ var styles = stylesMemoizer(_icon.euiIconStyles);
233
233
  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];
234
234
  var icon = this.state.icon || _empty.icon;
235
235
  if (typeof icon === 'string') {
@@ -246,30 +246,27 @@ var EuiIconClass = /*#__PURE__*/function (_PureComponent) {
246
246
 
247
247
  // If it's an empty icon, or if there is no aria-label, aria-labelledby, or title it gets aria-hidden true
248
248
  var isAriaHidden = icon === _empty.icon || !(this.props['aria-label'] || this.props['aria-labelledby'] || this.props.title);
249
- var hideIconEmpty = isAriaHidden && {
250
- 'aria-hidden': true
251
- };
252
- var titleId;
253
249
 
254
250
  // If no aria-label or aria-labelledby is provided but there's a title, a titleId is generated
255
251
  // The svg aria-labelledby attribute gets this titleId
256
252
  // The svg title element gets this titleId as an id
257
- if (!this.props['aria-label'] && !this.props['aria-labelledby'] && title) {
258
- titleId = {
259
- titleId: generateId()
260
- };
261
- }
253
+ var titleId = !this.props['aria-label'] && !this.props['aria-labelledby'] && title ? {
254
+ titleId: generateId()
255
+ } : undefined;
262
256
  return (0, _react3.jsx)(Svg, _extends({
263
257
  className: classes,
264
258
  style: optionalCustomStyles,
265
259
  css: cssStyles,
266
260
  tabIndex: tabIndex,
267
261
  role: "img",
268
- title: title,
262
+ title: title
263
+ }, titleId, {
269
264
  "data-icon-type": iconTitle,
270
265
  "data-is-loaded": isLoaded || undefined,
271
266
  "data-is-loading": isLoading || undefined
272
- }, titleId, rest, hideIconEmpty));
267
+ }, rest, {
268
+ "aria-hidden": isAriaHidden || undefined
269
+ }));
273
270
  }
274
271
  }
275
272
  }]);
@@ -311,5 +308,5 @@ EuiIconClass.propTypes = {
311
308
  */
312
309
  onIconLoad: _propTypes.default.func
313
310
  };
314
- var EuiIcon = (0, _services.withEuiTheme)(EuiIconClass);
311
+ var EuiIcon = (0, _services.withEuiStylesMemoizer)(EuiIconClass);
315
312
  exports.EuiIcon = EuiIcon;
@@ -15,9 +15,6 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
15
15
  * in compliance with, at your election, the Elastic License 2.0 or the Server
16
16
  * Side Public License, v 1.
17
17
  */
18
- var iconSize = function iconSize(size) {
19
- return "\n ".concat((0, _global_styling.logicalCSS)('width', size), ";\n ").concat((0, _global_styling.logicalCSS)('height', size), ";\n ");
20
- };
21
18
  var iconLoadingOpacity = 0.05;
22
19
  exports.iconLoadingOpacity = iconLoadingOpacity;
23
20
  var iconLoading = (0, _react.keyframes)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 0% {\n opacity: ", ";\n }\n\n 100% {\n opacity: 1;\n }\n"])), iconLoadingOpacity);
@@ -57,11 +54,11 @@ var euiIconStyles = function euiIconStyles(_ref3) {
57
54
  logoElasticOutline: _ref,
58
55
  // Sizes
59
56
  original: /*#__PURE__*/(0, _react.css)(";label:original;"),
60
- s: /*#__PURE__*/(0, _react.css)(iconSize(euiTheme.size.m), ";label:s;"),
61
- m: /*#__PURE__*/(0, _react.css)(iconSize(euiTheme.size.base), ";label:m;"),
62
- l: /*#__PURE__*/(0, _react.css)(iconSize(euiTheme.size.l), ";label:l;"),
63
- xl: /*#__PURE__*/(0, _react.css)(iconSize(euiTheme.size.xl), ";label:xl;"),
64
- xxl: /*#__PURE__*/(0, _react.css)(iconSize(euiTheme.size.xxl), ";label:xxl;"),
57
+ s: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalSizeCSS)(euiTheme.size.m), ";label:s;"),
58
+ m: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalSizeCSS)(euiTheme.size.base), ";label:m;"),
59
+ l: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalSizeCSS)(euiTheme.size.l), ";label:l;"),
60
+ xl: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalSizeCSS)(euiTheme.size.xl), ";label:xl;"),
61
+ xxl: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalSizeCSS)(euiTheme.size.xxl), ";label:xxl;"),
65
62
  // Variants
66
63
  // App icons are two-toned. This provides the base color.
67
64
  app: /*#__PURE__*/(0, _react.css)("fill:", euiTheme.colors.text, ";.euiIcon__fillSecondary{fill:", euiTheme.colors.successText, ";};label:app;"),
@@ -28,16 +28,19 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
28
28
  function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
29
29
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
30
30
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
31
- var EuiExternalLinkIcon = function EuiExternalLinkIcon(_ref) {
32
- var target = _ref.target,
33
- external = _ref.external,
34
- rest = _objectWithoutProperties(_ref, _excluded);
35
- var _useEuiTheme = (0, _services.useEuiTheme)(),
36
- euiTheme = _useEuiTheme.euiTheme;
31
+ var iconStyle = function iconStyle(_ref) {
32
+ var euiTheme = _ref.euiTheme;
33
+ return (0, _global_styling.logicalStyle)('margin-left', euiTheme.size.xs);
34
+ };
35
+ var EuiExternalLinkIcon = function EuiExternalLinkIcon(_ref2) {
36
+ var target = _ref2.target,
37
+ external = _ref2.external,
38
+ rest = _objectWithoutProperties(_ref2, _excluded);
39
+ var iconCssStyle = (0, _services.useEuiMemoizedStyles)(iconStyle);
37
40
  var showExternalLinkIcon = target === '_blank' && external !== false || external === true;
38
41
  var iconAriaLabel = (0, _i18n.useEuiI18n)('euiExternalLinkIcon.ariaLabel', 'External link');
39
42
  return (0, _react2.jsx)(_react.default.Fragment, null, showExternalLinkIcon && (0, _react2.jsx)(_icon.EuiIcon, _extends({
40
- css: (0, _global_styling.logicalStyle)('margin-left', euiTheme.size.xs),
43
+ css: iconCssStyle,
41
44
  "aria-label": iconAriaLabel,
42
45
  size: "s",
43
46
  type: "popout"
@@ -48,8 +48,7 @@ var EuiLink = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
48
48
  onClick = _ref.onClick,
49
49
  _disabled = _ref.disabled,
50
50
  rest = _objectWithoutProperties(_ref, _excluded);
51
- var euiTheme = (0, _services.useEuiTheme)();
52
- var styles = (0, _link.euiLinkStyles)(euiTheme);
51
+ var styles = (0, _services.useEuiMemoizedStyles)(_link.euiLinkStyles);
53
52
  var cssStyles = [styles.euiLink];
54
53
  var isHrefValid = !href || (0, _href_validator.validateHref)(href);
55
54
  var disabled = _disabled || !isHrefValid;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.euiLinkStyles = exports.euiLinkHoverCSS = exports.euiLinkFocusCSS = exports.euiLinkCSS = void 0;
6
+ exports.euiLinkStyles = exports.euiLinkCSS = void 0;
7
7
  var _react = require("@emotion/react");
8
8
  var _global_styling = require("../../global_styling");
9
9
  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)."; } /*
@@ -13,20 +13,9 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
13
13
  * in compliance with, at your election, the Elastic License 2.0 or the Server
14
14
  * Side Public License, v 1.
15
15
  */
16
- var _colorCSS = function _colorCSS(color) {
17
- return "\n color: ".concat(color, ";\n\n &:target {\n color: darken(").concat(color, ", 10%);\n }\n ");
18
- };
19
- var euiLinkHoverCSS = function euiLinkHoverCSS() {
20
- return "\n text-decoration: underline;\n ";
21
- };
22
- exports.euiLinkHoverCSS = euiLinkHoverCSS;
23
- var euiLinkFocusCSS = function euiLinkFocusCSS(euiTheme) {
24
- return "\n text-decoration: underline;\n text-decoration-thickness: ".concat(euiTheme.border.width.thick, ";\n ");
25
- };
26
- exports.euiLinkFocusCSS = euiLinkFocusCSS;
27
16
  var euiLinkCSS = function euiLinkCSS(euiThemeContext) {
28
17
  var euiTheme = euiThemeContext.euiTheme;
29
- return "\n font-weight: ".concat(euiTheme.font.weight.medium, ";\n ").concat((0, _global_styling.logicalTextAlignCSS)('left'), "\n\n &:hover {\n ").concat(euiLinkHoverCSS(), "\n }\n\n &:focus {\n ").concat((0, _global_styling.euiFocusRing)(euiThemeContext, 'outset'), "\n ").concat(euiLinkFocusCSS(euiTheme), "\n }\n ");
18
+ return "\n font-weight: ".concat(euiTheme.font.weight.medium, ";\n ").concat((0, _global_styling.logicalTextAlignCSS)('left'), "\n\n &:hover {\n text-decoration: underline;\n }\n\n &:focus {\n ").concat((0, _global_styling.euiFocusRing)(euiThemeContext, 'outset'), "\n text-decoration: underline;\n text-decoration-thickness: ").concat(euiTheme.border.width.thick, ";\n }\n ");
30
19
  };
31
20
  exports.euiLinkCSS = euiLinkCSS;
32
21
  var _ref = process.env.NODE_ENV === "production" ? {
@@ -53,4 +42,7 @@ var euiLinkStyles = function euiLinkStyles(euiThemeContext) {
53
42
  text: /*#__PURE__*/(0, _react.css)(_colorCSS(euiTheme.colors.text), ";label:text;")
54
43
  };
55
44
  };
56
- exports.euiLinkStyles = euiLinkStyles;
45
+ exports.euiLinkStyles = euiLinkStyles;
46
+ var _colorCSS = function _colorCSS(color) {
47
+ return "\n color: ".concat(color, ";\n\n &:target {\n color: darken(").concat(color, ", 10%);\n }\n ");
48
+ };
@@ -307,12 +307,14 @@ EuiPageHeaderContent.propTypes = {
307
307
  */
308
308
  "aria-current": _propTypes.default.any,
309
309
  /**
310
- * Creates a breadcrumb that toggles a popover dialog
310
+ * Creates a breadcrumb that toggles a popover dialog. Takes any rendered node(s),
311
+ * or a render function that will pass callback allowing you to close the
312
+ * breadcrumb popover from within your popover content.
311
313
  *
312
314
  * If passed, both `href` and `onClick` will be ignored - the breadcrumb's
313
315
  * click behavior should only trigger a popover.
314
316
  */
315
- popoverContent: _propTypes.default.node,
317
+ popoverContent: _propTypes.default.oneOfType([_propTypes.default.node.isRequired, _propTypes.default.func.isRequired]),
316
318
  /**
317
319
  * Allows customizing the popover if necessary. Accepts any props that
318
320
  * [EuiPopover](/#/layout/popover) accepts, except for props that control state.
@@ -66,7 +66,7 @@ var euiProgressStyles = function euiProgressStyles(_ref3, isNative) {
66
66
  // https://css-tricks.com/html5-progress-element/
67
67
  // Good resource if you need to work in here. There's some gotchas with
68
68
  // dealing with cross-browser progress bars.
69
- native: /*#__PURE__*/(0, _react.css)("display:block;", (0, _global_styling.logicalCSS)('width', '100%'), " appearance:none;border:none;border-radius:", euiTheme.size.s, ";&::-webkit-progress-bar{background-color:", euiTheme.colors.lightShade, ";}", crossBrowserProgressValue('transition: width ${euiTheme.animation.normal} linear;'), ";;label:native;"),
69
+ native: /*#__PURE__*/(0, _react.css)("display:block;", (0, _global_styling.logicalCSS)('width', '100%'), " appearance:none;border:none;border-radius:", euiTheme.size.s, ";&::-webkit-progress-bar{background-color:", euiTheme.colors.lightShade, ";}", _global_styling.euiCanAnimate, "{/* Note: FF/Mozilla doesn't actually support animating the native progress bar\n @see https://bugzilla.mozilla.org/show_bug.cgi?id=662351 */", crossBrowserProgressValue("transition: width ".concat(euiTheme.animation.normal, " linear")), ";};label:native;"),
70
70
  // An indeterminate bar has an unreliable end time. Because of a Firefox animation issue,
71
71
  // we apply this style to a <div> instead of a <progress> element.
72
72
  // See https://css-tricks.com/html5-progress-element/ for more info.
@@ -38,8 +38,7 @@ var EuiSkeletonCircle = function EuiSkeletonCircle(_ref) {
38
38
  ariaWrapperProps = _ref.ariaWrapperProps,
39
39
  children = _ref.children,
40
40
  rest = _objectWithoutProperties(_ref, _excluded);
41
- var euiTheme = (0, _services.useEuiTheme)();
42
- var styles = (0, _skeleton_circle.euiSkeletonCircleStyles)(euiTheme);
41
+ var styles = (0, _services.useEuiMemoizedStyles)(_skeleton_circle.euiSkeletonCircleStyles);
43
42
  var cssStyles = [styles.euiSkeletonCircle, styles[size]];
44
43
  return (0, _react2.jsx)(_skeleton_loading.EuiSkeletonLoading, _extends({
45
44
  isLoading: isLoading,
@@ -50,8 +50,7 @@ var EuiSkeletonRectangle = function EuiSkeletonRectangle(_ref) {
50
50
  ariaWrapperProps = _ref.ariaWrapperProps,
51
51
  children = _ref.children,
52
52
  rest = _objectWithoutProperties(_ref, _excluded);
53
- var euiTheme = (0, _services.useEuiTheme)();
54
- var styles = (0, _skeleton_rectangle.euiSkeletonRectangleStyles)(euiTheme);
53
+ var styles = (0, _services.useEuiMemoizedStyles)(_skeleton_rectangle.euiSkeletonRectangleStyles);
55
54
  var cssStyles = [styles.euiSkeletonRectangle, styles[borderRadius]];
56
55
  return (0, _react2.jsx)(_skeleton_loading.EuiSkeletonLoading, _extends({
57
56
  isLoading: isLoading,
@@ -1,10 +1,11 @@
1
1
  "use strict";
2
2
 
3
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.LINES = exports.EuiSkeletonText = void 0;
7
- var _react = _interopRequireDefault(require("react"));
8
+ var _react = _interopRequireWildcard(require("react"));
8
9
  var _propTypes = _interopRequireDefault(require("prop-types"));
9
10
  var _classnames = _interopRequireDefault(require("classnames"));
10
11
  var _services = require("../../services");
@@ -20,6 +21,8 @@ var _excluded = ["isLoading", "lines", "size", "className", "contentAriaLabel",
20
21
  * Side Public License, v 1.
21
22
  */
22
23
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
24
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
25
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
26
  function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
24
27
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
25
28
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
@@ -40,16 +43,20 @@ var EuiSkeletonText = function EuiSkeletonText(_ref) {
40
43
  ariaWrapperProps = _ref.ariaWrapperProps,
41
44
  children = _ref.children,
42
45
  rest = _objectWithoutProperties(_ref, _excluded);
43
- var euiTheme = (0, _services.useEuiTheme)();
44
- var styles = (0, _skeleton_text.euiSkeletonTextStyles)(euiTheme);
45
- var lineCssStyles = [styles.euiSkeletonText, styles[size]];
46
- var lineElements = [];
47
- for (var i = 0; i < lines; i++) {
48
- lineElements.push((0, _react2.jsx)("span", {
49
- key: i,
50
- css: lineCssStyles
51
- }));
52
- }
46
+ var styles = (0, _services.useEuiMemoizedStyles)(_skeleton_text.euiSkeletonTextStyles);
47
+ var cssStyles = (0, _react.useMemo)(function () {
48
+ return [styles.euiSkeletonText, styles[size]];
49
+ }, [styles, size]);
50
+ var lineElements = (0, _react.useMemo)(function () {
51
+ var lineElements = [];
52
+ for (var i = 0; i < lines; i++) {
53
+ lineElements.push((0, _react2.jsx)("span", {
54
+ key: i,
55
+ css: cssStyles
56
+ }));
57
+ }
58
+ return lineElements;
59
+ }, [lines, cssStyles]);
53
60
  return (0, _react2.jsx)(_skeleton_loading.EuiSkeletonLoading, _extends({
54
61
  isLoading: isLoading,
55
62
  loadingContent: (0, _react2.jsx)("span", _extends({
@@ -36,8 +36,7 @@ var EuiSkeletonTitle = function EuiSkeletonTitle(_ref) {
36
36
  ariaWrapperProps = _ref.ariaWrapperProps,
37
37
  children = _ref.children,
38
38
  rest = _objectWithoutProperties(_ref, _excluded);
39
- var euiTheme = (0, _services.useEuiTheme)();
40
- var styles = (0, _skeleton_title.euiSkeletonTitleStyles)(euiTheme);
39
+ var styles = (0, _services.useEuiMemoizedStyles)(_skeleton_title.euiSkeletonTitleStyles);
41
40
  var cssStyles = [styles.euiSkeletonTitle, styles[size]];
42
41
  return (0, _react2.jsx)(_skeleton_loading.EuiSkeletonLoading, _extends({
43
42
  isLoading: isLoading,
@@ -36,8 +36,7 @@ var EuiText = function EuiText(_ref) {
36
36
  children = _ref.children,
37
37
  className = _ref.className,
38
38
  rest = _objectWithoutProperties(_ref, _excluded);
39
- var euiTheme = (0, _services.useEuiTheme)();
40
- var styles = (0, _text.euiTextStyles)(euiTheme);
39
+ var styles = (0, _services.useEuiMemoizedStyles)(_text.euiTextStyles);
41
40
  var cssStyles = [styles.euiText, !grow ? styles.constrainedWidth : undefined, styles[size]];
42
41
  var classes = (0, _classnames.default)('euiText', className);
43
42
  var text = (0, _react2.jsx)("div", _extends({
@@ -37,8 +37,7 @@ var EuiTextAlign = function EuiTextAlign(_ref) {
37
37
  _ref$cloneElement = _ref.cloneElement,
38
38
  cloneElement = _ref$cloneElement === void 0 ? false : _ref$cloneElement,
39
39
  rest = _objectWithoutProperties(_ref, _excluded);
40
- var styles = (0, _text_align.euiTextAlignStyles)();
41
- var cssStyles = [styles.euiTextAlign, styles[textAlign]];
40
+ var cssStyles = [_text_align.euiTextAlignStyles.euiTextAlign, _text_align.euiTextAlignStyles[textAlign]];
42
41
  var props = _objectSpread({
43
42
  css: cssStyles
44
43
  }, rest);
@@ -14,12 +14,10 @@ var _global_styling = require("../../global_styling");
14
14
  * Side Public License, v 1.
15
15
  */
16
16
 
17
- var euiTextAlignStyles = function euiTextAlignStyles() {
18
- return {
19
- euiTextAlign: /*#__PURE__*/(0, _react.css)(";label:euiTextAlign;"),
20
- left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('left'), ";;label:left;"),
21
- right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('right'), ";;label:right;"),
22
- center: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('center'), ";;label:center;")
23
- };
17
+ var euiTextAlignStyles = {
18
+ euiTextAlign: /*#__PURE__*/(0, _react.css)(";label:euiTextAlign;"),
19
+ left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('left'), ";;label:left;"),
20
+ right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('right'), ";;label:right;"),
21
+ center: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalTextAlignCSS)('center'), ";;label:center;")
24
22
  };
25
23
  exports.euiTextAlignStyles = euiTextAlignStyles;
@@ -41,8 +41,7 @@ var EuiTextColor = function EuiTextColor(_ref) {
41
41
  style = _ref.style,
42
42
  rest = _objectWithoutProperties(_ref, _excluded);
43
43
  var isNamedColor = COLORS.includes(color);
44
- var euiTheme = (0, _services.useEuiTheme)();
45
- var styles = (0, _text_color.euiTextColorStyles)(euiTheme);
44
+ var styles = (0, _services.useEuiMemoizedStyles)(_text_color.euiTextColorStyles);
46
45
  var cssStyles = [styles.euiTextColor, isNamedColor ? styles[color] : styles.customColor];
47
46
 
48
47
  // We're checking if is a custom color.
@@ -36,8 +36,7 @@ var EuiTitle = function EuiTitle(_ref) {
36
36
  className = _ref.className,
37
37
  textTransform = _ref.textTransform,
38
38
  rest = _objectWithoutProperties(_ref, _excluded);
39
- var euiTheme = (0, _services.useEuiTheme)();
40
- var styles = (0, _title.euiTitleStyles)(euiTheme);
39
+ var styles = (0, _services.useEuiMemoizedStyles)(_title.euiTitleStyles);
41
40
  var cssStyles = [styles.euiTitle, textTransform ? styles[textTransform] : undefined, styles[size]];
42
41
  var classes = (0, _classnames.default)('euiTitle', className, children.props.className);
43
42
  var props = _objectSpread({