@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
@@ -1,4 +1,6 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
1
2
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
3
+ var _templateObject;
2
4
  /*
3
5
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
4
6
  * or more contributor license agreements. Licensed under the Elastic License
@@ -7,10 +9,11 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
7
9
  * Side Public License, v 1.
8
10
  */
9
11
 
10
- import { css } from '@emotion/react';
12
+ import { css, keyframes } from '@emotion/react';
11
13
  import { euiBackgroundColor, euiCanAnimate } from '../../../../global_styling';
12
- import { hexToRgb, isColorDark, makeHighContrastColor, shade, tint, transparentize, useEuiTheme } from '../../../../services';
14
+ import { hexToRgb, isColorDark, makeHighContrastColor, shade, tint, transparentize, useEuiMemoizedStyles } from '../../../../services';
13
15
  export var BUTTON_COLORS = ['text', 'accent', 'primary', 'success', 'warning', 'danger'];
16
+ export var BUTTON_DISPLAYS = ['base', 'fill', 'empty'];
14
17
  /**
15
18
  * Creates the `base` version of button styles with proper text contrast.
16
19
  * @param euiThemeContext
@@ -128,23 +131,35 @@ export var euiButtonEmptyColor = function euiButtonEmptyColor(euiThemeContext, c
128
131
  */
129
132
  export var useEuiButtonColorCSS = function useEuiButtonColorCSS() {
130
133
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
131
- var euiThemeContext = useEuiTheme();
132
- function stylesByDisplay(color) {
133
- return {
134
- base: /*#__PURE__*/css(euiButtonColor(euiThemeContext, color), ";;label:base;"),
135
- fill: /*#__PURE__*/css(euiButtonFillColor(euiThemeContext, color), "outline-color:", euiThemeContext.colorMode === 'DARK' && color === 'text' ? 'currentColor' : euiThemeContext.euiTheme.colors.fullShade, ";;label:fill;"),
136
- empty: /*#__PURE__*/css("color:", euiButtonEmptyColor(euiThemeContext, color).color, ";&:focus,&:active{background-color:", euiButtonEmptyColor(euiThemeContext, color).backgroundColor, ";};label:empty;")
137
- };
138
- }
139
- return {
140
- text: /*#__PURE__*/css(stylesByDisplay('text')[options.display || 'base'], ";label:text;"),
141
- accent: /*#__PURE__*/css(stylesByDisplay('accent')[options.display || 'base'], ";label:accent;"),
142
- primary: /*#__PURE__*/css(stylesByDisplay('primary')[options.display || 'base'], ";label:primary;"),
143
- success: /*#__PURE__*/css(stylesByDisplay('success')[options.display || 'base'], ";label:success;"),
144
- warning: /*#__PURE__*/css(stylesByDisplay('warning')[options.display || 'base'], ";label:warning;"),
145
- danger: /*#__PURE__*/css(stylesByDisplay('danger')[options.display || 'base'], ";label:danger;"),
146
- disabled: /*#__PURE__*/css(stylesByDisplay('disabled')[options.display || 'base'], ";label:disabled;")
147
- };
134
+ var _options$display = options.display,
135
+ display = _options$display === void 0 ? 'base' : _options$display;
136
+ var colorsDisplaysMap = useEuiMemoizedStyles(euiButtonDisplaysColors);
137
+ return colorsDisplaysMap[display];
138
+ };
139
+ var euiButtonDisplaysColors = function euiButtonDisplaysColors(euiThemeContext) {
140
+ var COLORS = [].concat(BUTTON_COLORS, ['disabled']);
141
+ var displaysColorsMap = {};
142
+ BUTTON_DISPLAYS.forEach(function (display) {
143
+ displaysColorsMap[display] = {};
144
+ COLORS.forEach(function (color) {
145
+ switch (display) {
146
+ case 'base':
147
+ displaysColorsMap[display][color] = /*#__PURE__*/css(euiButtonColor(euiThemeContext, color), ";;label:displaysColorsMap-display-color;");
148
+ break;
149
+ case 'fill':
150
+ displaysColorsMap[display][color] = /*#__PURE__*/css(euiButtonFillColor(euiThemeContext, color), "outline-color:", euiThemeContext.colorMode === 'DARK' && color === 'text' ? 'currentColor' : euiThemeContext.euiTheme.colors.fullShade, ";;label:displaysColorsMap-display-color;");
151
+ break;
152
+ case 'empty':
153
+ displaysColorsMap[display][color] = /*#__PURE__*/css("color:", euiButtonEmptyColor(euiThemeContext, color).color, ";&:focus,&:active{background-color:", euiButtonEmptyColor(euiThemeContext, color).backgroundColor, ";};label:displaysColorsMap-display-color;");
154
+ break;
155
+ }
156
+
157
+ // Tweak auto-generated Emotion label/className output
158
+ var emotionOutput = displaysColorsMap[display][color];
159
+ emotionOutput.styles = emotionOutput.styles.replace('label:displaysColorsMap-display-color;', "label:".concat(display, "-").concat(color, ";"));
160
+ });
161
+ });
162
+ return displaysColorsMap;
148
163
  };
149
164
 
150
165
  /**
@@ -152,17 +167,25 @@ export var useEuiButtonColorCSS = function useEuiButtonColorCSS() {
152
167
  * @returns string
153
168
  */
154
169
  export var useEuiButtonFocusCSS = function useEuiButtonFocusCSS() {
155
- var _useEuiTheme = useEuiTheme(),
156
- euiTheme = _useEuiTheme.euiTheme;
157
- return "\n ".concat(euiCanAnimate, " {\n transition: transform ").concat(euiTheme.animation.normal, " ease-in-out,\n background-color ").concat(euiTheme.animation.normal, " ease-in-out;\n\n &:hover:not(:disabled) {\n transform: translateY(-1px);\n }\n\n &:focus {\n animation: euiButtonActive ").concat(euiTheme.animation.normal, "\n ").concat(euiTheme.animation.bounce, ";\n }\n\n &:active:not(:disabled) {\n transform: translateY(1px);\n }\n }\n ");
170
+ return useEuiMemoizedStyles(euiButtonFocusCSS);
171
+ };
172
+ var euiButtonFocusAnimation = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 50% {\n transform: translateY(1px);\n }\n"])));
173
+ var euiButtonFocusCSS = function euiButtonFocusCSS(_ref) {
174
+ var euiTheme = _ref.euiTheme;
175
+ var focusCSS = /*#__PURE__*/css(euiCanAnimate, "{transition:transform ", euiTheme.animation.normal, " ease-in-out,background-color ", euiTheme.animation.normal, " ease-in-out;&:hover:not(:disabled){transform:translateY(-1px);}&:focus{animation:", euiButtonFocusAnimation, " ", euiTheme.animation.normal, " ", euiTheme.animation.bounce, ";}&:active:not(:disabled){transform:translateY(1px);}};label:focusCSS;");
176
+ // Remove the auto-generated label.
177
+ // We could typically avoid a label by using a plain string `` instead of css``,
178
+ // but we need css`` for keyframes`` to work for the focus animation
179
+ focusCSS.styles = focusCSS.styles.replace('label:focusCSS;', '');
180
+ return focusCSS;
158
181
  };
159
182
 
160
183
  /**
161
184
  * Map of `size` props to various sizings/scales
162
185
  * that should remain consistent across all buttons
163
186
  */
164
- export var euiButtonSizeMap = function euiButtonSizeMap(_ref) {
165
- var euiTheme = _ref.euiTheme;
187
+ export var euiButtonSizeMap = function euiButtonSizeMap(_ref2) {
188
+ var euiTheme = _ref2.euiTheme;
166
189
  return {
167
190
  xs: {
168
191
  height: euiTheme.size.l,
@@ -101,11 +101,12 @@ var EuiBreadcrumbContent = function EuiBreadcrumbContent(_ref2) {
101
101
  css: cssStyles
102
102
  };
103
103
  if (isPopoverBreadcrumb) {
104
+ var _closePopover = function _closePopover() {
105
+ return setIsPopoverOpen(false);
106
+ };
104
107
  return (0, _react2.jsx)(_popover.EuiPopover, (0, _extends2.default)({}, popoverProps, {
105
108
  isOpen: isPopoverOpen,
106
- closePopover: function closePopover() {
107
- return setIsPopoverOpen(false);
108
- },
109
+ closePopover: _closePopover,
109
110
  css: !isLastBreadcrumb && styles.euiBreadcrumb__popoverWrapper,
110
111
  button: (0, _react2.jsx)(_link.EuiLink, (0, _extends2.default)({}, baseProps, {
111
112
  color: linkColor,
@@ -122,7 +123,7 @@ var EuiBreadcrumbContent = function EuiBreadcrumbContent(_ref2) {
122
123
  size: "s",
123
124
  "aria-label": " - ".concat(popoverAriaLabel)
124
125
  }))
125
- }), popoverContent);
126
+ }), typeof popoverContent === 'function' ? popoverContent(_closePopover) : popoverContent);
126
127
  } else if (isInteractiveBreadcrumb) {
127
128
  return (0, _react2.jsx)(_link.EuiLink, (0, _extends2.default)({}, baseProps, styleProps, {
128
129
  color: linkColor,
@@ -78,8 +78,7 @@ var EuiButtonDisplay = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref)
78
78
  isDisabled: isDisabled || disabled,
79
79
  isLoading: isLoading
80
80
  });
81
- var theme = (0, _services.useEuiTheme)();
82
- var styles = (0, _button_display.euiButtonDisplayStyles)(theme);
81
+ var styles = (0, _services.useEuiMemoizedStyles)(_button_display.euiButtonDisplayStyles);
83
82
  var cssStyles = [styles.euiButtonDisplay, styles[size], fullWidth && styles.fullWidth, minWidth == null && styles.defaultMinWidth, buttonIsDisabled && styles.isDisabled];
84
83
  var innerNode = (0, _react2.jsx)(_button_display_content.EuiButtonDisplayContent, (0, _extends2.default)({
85
84
  isLoading: isLoading,
@@ -69,8 +69,7 @@ var EuiButtonEmpty = function EuiButtonEmpty(_ref) {
69
69
  var buttonColorStyles = (0, _button.useEuiButtonColorCSS)({
70
70
  display: 'empty'
71
71
  });
72
- var euiTheme = (0, _services.useEuiTheme)();
73
- var styles = (0, _button_empty.euiButtonEmptyStyles)(euiTheme);
72
+ var styles = (0, _services.useEuiMemoizedStyles)(_button_empty.euiButtonEmptyStyles);
74
73
  var cssStyles = [styles.euiButtonEmpty, styles[size], buttonColorStyles[isDisabled ? 'disabled' : color], flush && styles.flush, flush && styles[flush], isDisabled && styles.isDisabled];
75
74
  var classes = (0, _classnames.default)('euiButtonEmpty', className);
76
75
  var contentClassNames = (0, _classnames.default)('euiButtonEmpty__content', contentProps === null || contentProps === void 0 ? void 0 : contentProps.className);
@@ -46,10 +46,8 @@ var EuiButtonGroup = function EuiButtonGroup(_ref) {
46
46
  _ref$type = _ref.type,
47
47
  type = _ref$type === void 0 ? 'single' : _ref$type,
48
48
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
49
- var euiTheme = (0, _services.useEuiTheme)();
50
- var wrapperStyles = (0, _button_group.euiButtonGroupStyles)();
51
- var wrapperCssStyles = [wrapperStyles.euiButtonGroup, isFullWidth && wrapperStyles.fullWidth];
52
- var styles = (0, _button_group.euiButtonGroupButtonsStyles)(euiTheme);
49
+ var wrapperCssStyles = [_button_group.euiButtonGroupStyles.euiButtonGroup, isFullWidth && _button_group.euiButtonGroupStyles.fullWidth];
50
+ var styles = (0, _services.useEuiMemoizedStyles)(_button_group.euiButtonGroupButtonsStyles);
53
51
  var cssStyles = [styles.euiButtonGroup__buttons, isFullWidth && styles.fullWidth, styles[buttonSize]];
54
52
  var classes = (0, _classnames.default)('euiButtonGroup', {
55
53
  'euiButtonGroup-isDisabled': isDisabled
@@ -14,19 +14,16 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
14
14
  * in compliance with, at your election, the Elastic License 2.0 or the Server
15
15
  * Side Public License, v 1.
16
16
  */
17
- var _ref = process.env.NODE_ENV === "production" ? {
18
- name: "jl0hie-fullWidth",
19
- styles: "display:block;label:fullWidth;"
20
- } : {
21
- name: "jl0hie-fullWidth",
22
- styles: "display:block;label:fullWidth;",
23
- toString: _EMOTION_STRINGIFIED_CSS_ERROR__
24
- };
25
- var euiButtonGroupStyles = function euiButtonGroupStyles() {
26
- return {
27
- euiButtonGroup: /*#__PURE__*/(0, _react.css)("display:inline-block;", (0, _global_styling.logicalCSS)('max-width', '100%'), " position:relative;;label:euiButtonGroup;"),
28
- fullWidth: _ref
29
- };
17
+ var euiButtonGroupStyles = {
18
+ euiButtonGroup: /*#__PURE__*/(0, _react.css)("display:inline-block;", (0, _global_styling.logicalCSS)('max-width', '100%'), " position:relative;;label:euiButtonGroup;"),
19
+ fullWidth: process.env.NODE_ENV === "production" ? {
20
+ name: "jl0hie-fullWidth",
21
+ styles: "display:block;label:fullWidth;"
22
+ } : {
23
+ name: "jl0hie-fullWidth",
24
+ styles: "display:block;label:fullWidth;",
25
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
26
+ }
30
27
  };
31
28
  exports.euiButtonGroupStyles = euiButtonGroupStyles;
32
29
  var euiButtonGroupButtonsStyles = function euiButtonGroupButtonsStyles(euiThemeContext) {
@@ -50,7 +50,6 @@ var EuiButtonIcon = function EuiButtonIcon(_ref) {
50
50
  isSelected = _ref.isSelected,
51
51
  isLoading = _ref.isLoading,
52
52
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
53
- var euiThemeContext = (0, _services.useEuiTheme)();
54
53
  var isDisabled = (0, _button_display.isButtonDisabled)({
55
54
  isDisabled: _isDisabled || disabled,
56
55
  href: href,
@@ -65,9 +64,9 @@ var EuiButtonIcon = function EuiButtonIcon(_ref) {
65
64
  display: display
66
65
  });
67
66
  var buttonFocusStyle = (0, _button.useEuiButtonFocusCSS)();
68
- var emptyHoverStyles = display === 'empty' && !isDisabled && (0, _button_icon._emptyHoverStyles)(euiThemeContext, color);
69
- var styles = (0, _button_icon.euiButtonIconStyles)(euiThemeContext);
70
- var cssStyles = [styles.euiButtonIcon, styles[size], buttonColorStyles[isDisabled ? 'disabled' : color], buttonFocusStyle, emptyHoverStyles, isDisabled && styles.isDisabled];
67
+ var emptyHoverStyles = (0, _services.useEuiMemoizedStyles)(_button_icon._emptyHoverStyles);
68
+ var styles = (0, _services.useEuiMemoizedStyles)(_button_icon.euiButtonIconStyles);
69
+ var cssStyles = [styles.euiButtonIcon, styles[size], buttonColorStyles[isDisabled ? 'disabled' : color], buttonFocusStyle, display === 'empty' && !isDisabled && emptyHoverStyles[color], isDisabled && styles.isDisabled];
71
70
  var classes = (0, _classnames.default)('euiButtonIcon', className);
72
71
 
73
72
  // Add an icon to the button if one exists.
@@ -1,13 +1,17 @@
1
1
  "use strict";
2
2
 
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
3
4
  Object.defineProperty(exports, "__esModule", {
4
5
  value: true
5
6
  });
6
7
  exports.euiButtonIconStyles = exports._emptyHoverStyles = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
7
9
  var _react = require("@emotion/react");
8
10
  var _global_styling = require("../../../global_styling");
9
11
  var _button = require("../../../themes/amsterdam/global_styling/mixins/button");
10
12
  var _button_display = require("../button_display/_button_display.styles");
13
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
14
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
11
15
  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)."; } /*
12
16
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
13
17
  * or more contributor license agreements. Licensed under the Elastic License
@@ -35,7 +39,9 @@ var euiButtonIconStyles = function euiButtonIconStyles(euiThemeContext) {
35
39
  };
36
40
  };
37
41
  exports.euiButtonIconStyles = euiButtonIconStyles;
38
- var _emptyHoverStyles = function _emptyHoverStyles(euiThemeContext, color) {
39
- return /*#__PURE__*/(0, _react.css)("&:hover{background-color:", (0, _button.euiButtonEmptyColor)(euiThemeContext, color).backgroundColor, ";}");
42
+ var _emptyHoverStyles = function _emptyHoverStyles(euiThemeContext) {
43
+ return _button.BUTTON_COLORS.reduce(function (styles, color) {
44
+ return _objectSpread(_objectSpread({}, styles), {}, (0, _defineProperty2.default)({}, color, /*#__PURE__*/(0, _react.css)("&:hover{background-color:", (0, _button.euiButtonEmptyColor)(euiThemeContext, color).backgroundColor, ";}")));
45
+ }, {});
40
46
  };
41
47
  exports._emptyHoverStyles = _emptyHoverStyles;
@@ -29,7 +29,7 @@ var _data_grid_cell_actions = require("./data_grid_cell_actions");
29
29
  var _data_grid_cell_popover = require("./data_grid_cell_popover");
30
30
  var _focus_utils = require("./focus_utils");
31
31
  var _react2 = require("@emotion/react");
32
- var _excluded = ["renderCellValue", "column", "setCellContentsRef", "rowIndex", "colIndex", "ariaRowIndex", "rowHeight", "rowHeightUtils", "isControlColumn", "isFocused", "cellActions"],
32
+ var _excluded = ["renderCellValue", "cellContext", "column", "setCellContentsRef", "rowIndex", "colIndex", "ariaRowIndex", "rowHeight", "rowHeightUtils", "isControlColumn", "isFocused", "cellActions"],
33
33
  _excluded2 = ["width", "popoverContext", "interactiveCellId", "columnType", "className", "column", "style", "rowHeightUtils", "rowHeightsOptions", "rowManager", "pagination"],
34
34
  _excluded3 = ["isExpandable", "style", "className", "data-test-subj"];
35
35
  /*
@@ -47,6 +47,7 @@ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflec
47
47
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
48
48
  var EuiDataGridCellContent = /*#__PURE__*/(0, _react.memo)(function (_ref) {
49
49
  var renderCellValue = _ref.renderCellValue,
50
+ cellContext = _ref.cellContext,
50
51
  column = _ref.column,
51
52
  setCellContentsRef = _ref.setCellContentsRef,
52
53
  rowIndex = _ref.rowIndex,
@@ -75,7 +76,7 @@ var EuiDataGridCellContent = /*#__PURE__*/(0, _react.memo)(function (_ref) {
75
76
  rowIndex: rowIndex,
76
77
  colIndex: colIndex,
77
78
  schema: (column === null || column === void 0 ? void 0 : column.schema) || rest.columnType
78
- }, rest)));
79
+ }, cellContext, rest)));
79
80
  if (cellHeightType === 'lineCount' && !isControlColumn) {
80
81
  var lines = rowHeightUtils.getLineCount(rowHeight);
81
82
  cellContent = (0, _react2.jsx)(_text_truncate.EuiTextBlockTruncate, {
@@ -258,6 +259,7 @@ var EuiDataGridCell = /*#__PURE__*/function (_Component) {
258
259
  var _this$props5 = _this.props,
259
260
  renderCellPopover = _this$props5.renderCellPopover,
260
261
  renderCellValue = _this$props5.renderCellValue,
262
+ cellContext = _this$props5.cellContext,
261
263
  rowIndex = _this$props5.rowIndex,
262
264
  colIndex = _this$props5.colIndex,
263
265
  column = _this$props5.column,
@@ -278,7 +280,7 @@ var EuiDataGridCell = /*#__PURE__*/function (_Component) {
278
280
  })),
279
281
  DefaultCellPopover: _data_grid_cell_popover.DefaultCellPopover,
280
282
  setCellPopoverProps: setCellPopoverProps
281
- }), (0, _react2.jsx)(CellElement, (0, _extends2.default)({}, sharedProps, {
283
+ }), (0, _react2.jsx)(CellElement, (0, _extends2.default)({}, cellContext, sharedProps, {
282
284
  setCellProps: _this.setCellProps,
283
285
  isExpandable: true,
284
286
  isExpanded: true,
@@ -15,7 +15,7 @@ var _sorting = require("../../utils/sorting");
15
15
  var _data_grid_cell_popover = require("./data_grid_cell_popover");
16
16
  var _data_grid_cell = require("./data_grid_cell");
17
17
  var _react2 = require("@emotion/react");
18
- var _excluded = ["colIndex", "visibleRowIndex", "style", "schema", "schemaDetectors", "pagination", "columns", "leadingControlColumns", "trailingControlColumns", "visibleColCount", "columnWidths", "defaultColumnWidth", "renderCellValue", "renderCellPopover", "interactiveCellId", "setRowHeight", "rowHeightsOptions", "rowHeightUtils", "rowManager"];
18
+ var _excluded = ["colIndex", "visibleRowIndex", "style", "schema", "schemaDetectors", "pagination", "columns", "leadingControlColumns", "trailingControlColumns", "visibleColCount", "columnWidths", "defaultColumnWidth", "renderCellValue", "cellContext", "renderCellPopover", "interactiveCellId", "setRowHeight", "rowHeightsOptions", "rowHeightUtils", "rowManager"];
19
19
  /*
20
20
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
21
21
  * or more contributor license agreements. Licensed under the Elastic License
@@ -44,6 +44,7 @@ var Cell = function Cell(_ref) {
44
44
  columnWidths = _ref.columnWidths,
45
45
  defaultColumnWidth = _ref.defaultColumnWidth,
46
46
  renderCellValue = _ref.renderCellValue,
47
+ cellContext = _ref.cellContext,
47
48
  renderCellPopover = _ref.renderCellPopover,
48
49
  interactiveCellId = _ref.interactiveCellId,
49
50
  setRowHeight = _ref.setRowHeight,
@@ -85,7 +86,8 @@ var Cell = function Cell(_ref) {
85
86
  setRowHeight: isFirstColumn ? setRowHeight : undefined,
86
87
  rowManager: rowManager,
87
88
  popoverContext: popoverContext,
88
- pagination: pagination
89
+ pagination: pagination,
90
+ cellContext: cellContext
89
91
  };
90
92
  if (isLeadingControlColumn) {
91
93
  var leadingColumn = leadingControlColumns[colIndex];
@@ -41,6 +41,7 @@ var EuiDataGridBodyCustomRender = function EuiDataGridBodyCustomRender(_ref) {
41
41
  schemaDetectors = _ref.schemaDetectors,
42
42
  visibleRows = _ref.visibleRows,
43
43
  renderCellValue = _ref.renderCellValue,
44
+ cellContext = _ref.cellContext,
44
45
  renderCellPopover = _ref.renderCellPopover,
45
46
  renderFooterCellValue = _ref.renderFooterCellValue,
46
47
  interactiveCellId = _ref.interactiveCellId,
@@ -130,6 +131,7 @@ var EuiDataGridBodyCustomRender = function EuiDataGridBodyCustomRender(_ref) {
130
131
  columnWidths: columnWidths,
131
132
  defaultColumnWidth: defaultColumnWidth,
132
133
  renderCellValue: renderCellValue,
134
+ cellContext: cellContext,
133
135
  renderCellPopover: renderCellPopover,
134
136
  interactiveCellId: interactiveCellId,
135
137
  setRowHeight: setRowHeight,
@@ -88,6 +88,7 @@ var EuiDataGridBodyVirtualized = function EuiDataGridBodyVirtualized(_ref3) {
88
88
  endRow = _ref3$visibleRows.endRow,
89
89
  visibleRowCount = _ref3$visibleRows.visibleRowCount,
90
90
  renderCellValue = _ref3.renderCellValue,
91
+ cellContext = _ref3.cellContext,
91
92
  renderCellPopover = _ref3.renderCellPopover,
92
93
  renderFooterCellValue = _ref3.renderFooterCellValue,
93
94
  interactiveCellId = _ref3.interactiveCellId,
@@ -289,6 +290,7 @@ var EuiDataGridBodyVirtualized = function EuiDataGridBodyVirtualized(_ref3) {
289
290
  columnWidths: columnWidths,
290
291
  defaultColumnWidth: defaultColumnWidth,
291
292
  renderCellValue: renderCellValue,
293
+ cellContext: cellContext,
292
294
  renderCellPopover: renderCellPopover,
293
295
  interactiveCellId: interactiveCellId,
294
296
  rowHeightsOptions: rowHeightsOptions,
@@ -85,7 +85,7 @@ var useRowManager = function useRowManager(_ref) {
85
85
  if (rowClasses) {
86
86
  rowIdToElements.current.forEach(function (rowElement, rowIndex) {
87
87
  var euiClasses = Array.from(rowElement.classList).filter(function (className) {
88
- return className.startsWith('euiDataGridRow');
88
+ return ['euiDataGridRow', 'euiDataGridRow--striped'].includes(className);
89
89
  }).join(' ');
90
90
  if (rowClasses[rowIndex]) {
91
91
  rowElement.classList.value = "".concat(euiClasses, " ").concat(rowClasses[rowIndex]);
@@ -31,7 +31,7 @@ var _data_grid_schema = require("./utils/data_grid_schema");
31
31
  var _ref = require("./utils/ref");
32
32
  var _data_grid_types = require("./data_grid_types");
33
33
  var _react2 = require("@emotion/react");
34
- 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"],
34
+ 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"],
35
35
  _excluded2 = ["focusProps"];
36
36
  /*
37
37
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
@@ -84,6 +84,7 @@ var EuiDataGrid = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forward
84
84
  schemaDetectors = props.schemaDetectors,
85
85
  rowCount = props.rowCount,
86
86
  renderCellValue = props.renderCellValue,
87
+ cellContext = props.cellContext,
87
88
  renderCellPopover = props.renderCellPopover,
88
89
  renderFooterCellValue = props.renderFooterCellValue,
89
90
  className = props.className,
@@ -353,6 +354,7 @@ var EuiDataGrid = /*#__PURE__*/(0, _react.memo)( /*#__PURE__*/(0, _react.forward
353
354
  schemaDetectors: allSchemaDetectors,
354
355
  pagination: pagination,
355
356
  renderCellValue: renderCellValue,
357
+ cellContext: cellContext,
356
358
  renderCellPopover: renderCellPopover,
357
359
  renderFooterCellValue: renderFooterCellValue,
358
360
  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;
@@ -31,7 +31,7 @@ var _services = require("../../services");
31
31
  var _named_colors = require("./named_colors");
32
32
  var _icon = require("./icon.styles");
33
33
  var _react3 = require("@emotion/react");
34
- var _excluded = ["type", "size", "color", "className", "tabIndex", "title", "onIconLoad", "theme", "style"];
34
+ var _excluded = ["type", "size", "color", "className", "tabIndex", "title", "onIconLoad", "style", "stylesMemoizer"];
35
35
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
36
36
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
37
37
  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); }
@@ -200,8 +200,8 @@ var EuiIconClass = /*#__PURE__*/function (_PureComponent) {
200
200
  tabIndex = _this$props.tabIndex,
201
201
  title = _this$props.title,
202
202
  onIconLoad = _this$props.onIconLoad,
203
- theme = _this$props.theme,
204
203
  style = _this$props.style,
204
+ stylesMemoizer = _this$props.stylesMemoizer,
205
205
  rest = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
206
206
  var _this$state = this.state,
207
207
  isLoading = _this$state.isLoading,
@@ -223,7 +223,7 @@ var EuiIconClass = /*#__PURE__*/function (_PureComponent) {
223
223
  var classes = (0, _classnames.default)('euiIcon', className);
224
224
 
225
225
  // Emotion styles
226
- var styles = (0, _icon.euiIconStyles)(theme);
226
+ var styles = stylesMemoizer(_icon.euiIconStyles);
227
227
  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];
228
228
  var icon = this.state.icon || _empty.icon;
229
229
  if (typeof icon === 'string') {
@@ -240,35 +240,32 @@ var EuiIconClass = /*#__PURE__*/function (_PureComponent) {
240
240
 
241
241
  // If it's an empty icon, or if there is no aria-label, aria-labelledby, or title it gets aria-hidden true
242
242
  var isAriaHidden = icon === _empty.icon || !(this.props['aria-label'] || this.props['aria-labelledby'] || this.props.title);
243
- var hideIconEmpty = isAriaHidden && {
244
- 'aria-hidden': true
245
- };
246
- var titleId;
247
243
 
248
244
  // If no aria-label or aria-labelledby is provided but there's a title, a titleId is generated
249
245
  // The svg aria-labelledby attribute gets this titleId
250
246
  // The svg title element gets this titleId as an id
251
- if (!this.props['aria-label'] && !this.props['aria-labelledby'] && title) {
252
- titleId = {
253
- titleId: generateId()
254
- };
255
- }
247
+ var titleId = !this.props['aria-label'] && !this.props['aria-labelledby'] && title ? {
248
+ titleId: generateId()
249
+ } : undefined;
256
250
  return (0, _react3.jsx)(Svg, (0, _extends2.default)({
257
251
  className: classes,
258
252
  style: optionalCustomStyles,
259
253
  css: cssStyles,
260
254
  tabIndex: tabIndex,
261
255
  role: "img",
262
- title: title,
256
+ title: title
257
+ }, titleId, {
263
258
  "data-icon-type": iconTitle,
264
259
  "data-is-loaded": isLoaded || undefined,
265
260
  "data-is-loading": isLoading || undefined
266
- }, titleId, rest, hideIconEmpty));
261
+ }, rest, {
262
+ "aria-hidden": isAriaHidden || undefined
263
+ }));
267
264
  }
268
265
  }
269
266
  }]);
270
267
  return EuiIconClass;
271
268
  }(_react.PureComponent);
272
269
  exports.EuiIconClass = EuiIconClass;
273
- var EuiIcon = (0, _services.withEuiTheme)(EuiIconClass);
270
+ var EuiIcon = (0, _services.withEuiStylesMemoizer)(EuiIconClass);
274
271
  exports.EuiIcon = EuiIcon;
@@ -16,9 +16,6 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
16
16
  * in compliance with, at your election, the Elastic License 2.0 or the Server
17
17
  * Side Public License, v 1.
18
18
  */
19
- var iconSize = function iconSize(size) {
20
- return "\n ".concat((0, _global_styling.logicalCSS)('width', size), ";\n ").concat((0, _global_styling.logicalCSS)('height', size), ";\n ");
21
- };
22
19
  var iconLoadingOpacity = 0.05;
23
20
  exports.iconLoadingOpacity = iconLoadingOpacity;
24
21
  var iconLoading = (0, _react.keyframes)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n 0% {\n opacity: ", ";\n }\n\n 100% {\n opacity: 1;\n }\n"])), iconLoadingOpacity);
@@ -58,11 +55,11 @@ var euiIconStyles = function euiIconStyles(_ref3) {
58
55
  logoElasticOutline: _ref,
59
56
  // Sizes
60
57
  original: /*#__PURE__*/(0, _react.css)(";label:original;"),
61
- s: /*#__PURE__*/(0, _react.css)(iconSize(euiTheme.size.m), ";label:s;"),
62
- m: /*#__PURE__*/(0, _react.css)(iconSize(euiTheme.size.base), ";label:m;"),
63
- l: /*#__PURE__*/(0, _react.css)(iconSize(euiTheme.size.l), ";label:l;"),
64
- xl: /*#__PURE__*/(0, _react.css)(iconSize(euiTheme.size.xl), ";label:xl;"),
65
- xxl: /*#__PURE__*/(0, _react.css)(iconSize(euiTheme.size.xxl), ";label:xxl;"),
58
+ s: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalSizeCSS)(euiTheme.size.m), ";label:s;"),
59
+ m: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalSizeCSS)(euiTheme.size.base), ";label:m;"),
60
+ l: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalSizeCSS)(euiTheme.size.l), ";label:l;"),
61
+ xl: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalSizeCSS)(euiTheme.size.xl), ";label:xl;"),
62
+ xxl: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalSizeCSS)(euiTheme.size.xxl), ";label:xxl;"),
66
63
  // Variants
67
64
  // App icons are two-toned. This provides the base color.
68
65
  app: /*#__PURE__*/(0, _react.css)("fill:", euiTheme.colors.text, ";.euiIcon__fillSecondary{fill:", euiTheme.colors.successText, ";};label:app;"),
@@ -26,16 +26,19 @@ var _excluded = ["target", "external"];
26
26
  * DRY util for indicating external links both via icon and to
27
27
  * screen readers. Used internally by at EuiLink and EuiListGroupItem
28
28
  */
29
- var EuiExternalLinkIcon = function EuiExternalLinkIcon(_ref) {
30
- var target = _ref.target,
31
- external = _ref.external,
32
- rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
33
- var _useEuiTheme = (0, _services.useEuiTheme)(),
34
- euiTheme = _useEuiTheme.euiTheme;
29
+ var iconStyle = function iconStyle(_ref) {
30
+ var euiTheme = _ref.euiTheme;
31
+ return (0, _global_styling.logicalStyle)('margin-left', euiTheme.size.xs);
32
+ };
33
+ var EuiExternalLinkIcon = function EuiExternalLinkIcon(_ref2) {
34
+ var target = _ref2.target,
35
+ external = _ref2.external,
36
+ rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
37
+ var iconCssStyle = (0, _services.useEuiMemoizedStyles)(iconStyle);
35
38
  var showExternalLinkIcon = target === '_blank' && external !== false || external === true;
36
39
  var iconAriaLabel = (0, _i18n.useEuiI18n)('euiExternalLinkIcon.ariaLabel', 'External link');
37
40
  return (0, _react2.jsx)(_react.default.Fragment, null, showExternalLinkIcon && (0, _react2.jsx)(_icon.EuiIcon, (0, _extends2.default)({
38
- css: (0, _global_styling.logicalStyle)('margin-left', euiTheme.size.xs),
41
+ css: iconCssStyle,
39
42
  "aria-label": iconAriaLabel,
40
43
  size: "s",
41
44
  type: "popout"
@@ -44,8 +44,7 @@ var EuiLink = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
44
44
  onClick = _ref.onClick,
45
45
  _disabled = _ref.disabled,
46
46
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
47
- var euiTheme = (0, _services.useEuiTheme)();
48
- var styles = (0, _link.euiLinkStyles)(euiTheme);
47
+ var styles = (0, _services.useEuiMemoizedStyles)(_link.euiLinkStyles);
49
48
  var cssStyles = [styles.euiLink];
50
49
  var isHrefValid = !href || (0, _href_validator.validateHref)(href);
51
50
  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
+ };