@elastic/eui 67.0.0 → 67.1.1

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 (283) hide show
  1. package/dist/eui_theme_dark.css +0 -390
  2. package/dist/eui_theme_dark.json +0 -24
  3. package/dist/eui_theme_dark.json.d.ts +0 -24
  4. package/dist/eui_theme_dark.min.css +1 -1
  5. package/dist/eui_theme_light.css +0 -390
  6. package/dist/eui_theme_light.json +0 -24
  7. package/dist/eui_theme_light.json.d.ts +0 -24
  8. package/dist/eui_theme_light.min.css +1 -1
  9. package/es/components/accordion/accordion.js +5 -4
  10. package/es/components/accordion/accordion.styles.js +1 -1
  11. package/es/components/badge/badge.js +84 -78
  12. package/es/components/badge/badge.styles.js +62 -0
  13. package/es/components/basic_table/in_memory_table.js +8 -0
  14. package/es/components/breadcrumbs/breadcrumb.styles.js +4 -2
  15. package/es/components/button/button.js +0 -1
  16. package/es/components/button/button_display/_button_display.js +10 -5
  17. package/es/components/button/button_display/_button_display.styles.js +2 -2
  18. package/es/components/button/button_display/_button_display_content.js +5 -3
  19. package/es/components/button/button_display/_button_display_content.styles.js +4 -1
  20. package/es/components/button/button_icon/button_icon.js +11 -7
  21. package/es/components/card/card.js +2 -2
  22. package/es/components/card/card.styles.js +5 -2
  23. package/es/components/collapsible_nav/collapsible_nav.js +8 -0
  24. package/es/components/expression/expression.styles.js +4 -2
  25. package/es/components/flyout/flyout.js +27 -48
  26. package/es/components/flyout/flyout.styles.js +111 -0
  27. package/es/components/flyout/flyout_body.js +14 -6
  28. package/es/components/flyout/flyout_body.styles.js +21 -0
  29. package/es/components/flyout/flyout_footer.js +8 -1
  30. package/es/components/flyout/flyout_footer.styles.js +14 -0
  31. package/es/components/flyout/flyout_header.js +9 -4
  32. package/es/components/flyout/flyout_header.styles.js +28 -0
  33. package/es/components/image/image_wrapper.js +3 -3
  34. package/es/components/markdown_editor/markdown_format.styles.js +11 -6
  35. package/es/components/notification/notification_event.js +1 -1
  36. package/es/components/notification/notification_event_meta.js +1 -1
  37. package/es/components/page/page_header/page_header_content.js +1 -1
  38. package/es/components/page/page_section/page_section.js +3 -4
  39. package/es/components/pagination/pagination_button.styles.js +5 -3
  40. package/es/components/popover/popover_title.js +2 -2
  41. package/es/components/popover/popover_title.styles.js +18 -6
  42. package/es/components/progress/progress.js +2 -2
  43. package/es/components/search_bar/filters/custom_component_filter.js +16 -0
  44. package/es/components/search_bar/filters/filters.js +6 -0
  45. package/es/components/search_bar/query/ast.js +12 -0
  46. package/es/components/search_bar/query/ast_to_es_query_dsl.js +15 -10
  47. package/es/components/search_bar/query/query.js +17 -0
  48. package/es/components/search_bar/search_bar.js +4 -0
  49. package/es/components/search_bar/search_filters.js +4 -0
  50. package/es/components/selectable/selectable_list/selectable_list.js +2 -2
  51. package/es/components/selectable/selectable_list/selectable_list_item.js +2 -2
  52. package/es/components/text/text.styles.js +6 -3
  53. package/es/components/tool_tip/tool_tip.styles.js +7 -6
  54. package/es/components/tour/tour.styles.js +11 -6
  55. package/es/global_styling/functions/index.js +1 -0
  56. package/es/global_styling/functions/math.js +46 -0
  57. package/es/global_styling/mixins/_helpers.js +5 -2
  58. package/es/services/color/contrast.js +2 -0
  59. package/es/services/index.js +1 -1
  60. package/es/services/theme/context.js +2 -1
  61. package/es/services/theme/hooks.js +27 -1
  62. package/es/services/theme/index.js +1 -1
  63. package/es/services/theme/provider.js +15 -1
  64. package/eui.d.ts +199 -35
  65. package/i18ntokens.json +2 -2
  66. package/lib/components/accordion/accordion.js +5 -4
  67. package/lib/components/accordion/accordion.styles.js +1 -1
  68. package/lib/components/badge/badge.js +92 -80
  69. package/lib/components/badge/badge.styles.js +67 -0
  70. package/lib/components/basic_table/in_memory_table.js +8 -0
  71. package/lib/components/breadcrumbs/breadcrumb.styles.js +3 -1
  72. package/lib/components/button/button.js +0 -1
  73. package/lib/components/button/button_display/_button_display.js +10 -5
  74. package/lib/components/button/button_display/_button_display.styles.js +2 -2
  75. package/lib/components/button/button_display/_button_display_content.js +9 -4
  76. package/lib/components/button/button_display/_button_display_content.styles.js +4 -1
  77. package/lib/components/button/button_icon/button_icon.js +11 -7
  78. package/lib/components/card/card.js +2 -2
  79. package/lib/components/card/card.styles.js +5 -2
  80. package/lib/components/collapsible_nav/collapsible_nav.js +8 -0
  81. package/lib/components/expression/expression.styles.js +3 -1
  82. package/lib/components/flyout/flyout.js +27 -47
  83. package/lib/components/flyout/flyout.styles.js +122 -0
  84. package/lib/components/flyout/flyout_body.js +16 -6
  85. package/lib/components/flyout/flyout_body.styles.js +32 -0
  86. package/lib/components/flyout/flyout_footer.js +10 -1
  87. package/lib/components/flyout/flyout_footer.styles.js +24 -0
  88. package/lib/components/flyout/flyout_header.js +11 -4
  89. package/lib/components/flyout/flyout_header.styles.js +31 -0
  90. package/lib/components/image/image_wrapper.js +3 -3
  91. package/lib/components/markdown_editor/markdown_format.styles.js +10 -5
  92. package/lib/components/notification/notification_event.js +1 -1
  93. package/lib/components/notification/notification_event_meta.js +1 -1
  94. package/lib/components/page/page_header/page_header_content.js +1 -1
  95. package/lib/components/page/page_section/page_section.js +3 -4
  96. package/lib/components/pagination/pagination_button.styles.js +4 -2
  97. package/lib/components/popover/popover_title.js +2 -2
  98. package/lib/components/popover/popover_title.styles.js +19 -7
  99. package/lib/components/progress/progress.js +2 -2
  100. package/lib/components/search_bar/filters/custom_component_filter.js +29 -0
  101. package/lib/components/search_bar/filters/filters.js +7 -0
  102. package/lib/components/search_bar/query/ast.js +12 -0
  103. package/lib/components/search_bar/query/ast_to_es_query_dsl.js +16 -11
  104. package/lib/components/search_bar/query/query.js +17 -0
  105. package/lib/components/search_bar/search_bar.js +4 -0
  106. package/lib/components/search_bar/search_filters.js +4 -0
  107. package/lib/components/selectable/selectable_list/selectable_list.js +2 -2
  108. package/lib/components/selectable/selectable_list/selectable_list_item.js +2 -2
  109. package/lib/components/text/text.styles.js +5 -2
  110. package/lib/components/tool_tip/tool_tip.styles.js +6 -5
  111. package/lib/components/tour/tour.styles.js +10 -5
  112. package/lib/global_styling/functions/index.js +13 -0
  113. package/lib/global_styling/functions/math.js +55 -0
  114. package/lib/global_styling/mixins/_helpers.js +5 -2
  115. package/lib/services/color/contrast.js +6 -1
  116. package/lib/services/index.js +7 -0
  117. package/lib/services/theme/context.js +4 -2
  118. package/lib/services/theme/hooks.js +28 -0
  119. package/lib/services/theme/index.js +12 -0
  120. package/lib/services/theme/provider.js +23 -2
  121. package/optimize/es/components/accordion/accordion.js +5 -4
  122. package/optimize/es/components/accordion/accordion.styles.js +1 -1
  123. package/optimize/es/components/badge/badge.js +82 -76
  124. package/optimize/es/components/badge/badge.styles.js +62 -0
  125. package/optimize/es/components/basic_table/in_memory_table.js +4 -0
  126. package/optimize/es/components/breadcrumbs/breadcrumb.styles.js +4 -2
  127. package/optimize/es/components/button/button.js +0 -1
  128. package/optimize/es/components/button/button_display/_button_display.js +8 -3
  129. package/optimize/es/components/button/button_display/_button_display.styles.js +2 -2
  130. package/optimize/es/components/button/button_display/_button_display_content.js +3 -1
  131. package/optimize/es/components/button/button_display/_button_display_content.styles.js +4 -1
  132. package/optimize/es/components/button/button_icon/button_icon.js +11 -7
  133. package/optimize/es/components/card/card.js +2 -2
  134. package/optimize/es/components/card/card.styles.js +5 -2
  135. package/optimize/es/components/expression/expression.styles.js +4 -2
  136. package/optimize/es/components/flyout/flyout.js +27 -48
  137. package/optimize/es/components/flyout/flyout.styles.js +111 -0
  138. package/optimize/es/components/flyout/flyout_body.js +14 -6
  139. package/optimize/es/components/flyout/flyout_body.styles.js +21 -0
  140. package/optimize/es/components/flyout/flyout_footer.js +8 -1
  141. package/optimize/es/components/flyout/flyout_footer.styles.js +14 -0
  142. package/optimize/es/components/flyout/flyout_header.js +9 -4
  143. package/optimize/es/components/flyout/flyout_header.styles.js +28 -0
  144. package/optimize/es/components/image/image_wrapper.js +3 -3
  145. package/optimize/es/components/markdown_editor/markdown_format.styles.js +11 -6
  146. package/optimize/es/components/page/page_header/page_header_content.js +1 -1
  147. package/optimize/es/components/page/page_section/page_section.js +3 -4
  148. package/optimize/es/components/pagination/pagination_button.styles.js +5 -3
  149. package/optimize/es/components/popover/popover_title.js +2 -2
  150. package/optimize/es/components/popover/popover_title.styles.js +18 -6
  151. package/optimize/es/components/progress/progress.js +2 -2
  152. package/optimize/es/components/search_bar/filters/custom_component_filter.js +16 -0
  153. package/optimize/es/components/search_bar/filters/filters.js +6 -0
  154. package/optimize/es/components/search_bar/query/ast.js +12 -0
  155. package/optimize/es/components/search_bar/query/ast_to_es_query_dsl.js +14 -9
  156. package/optimize/es/components/search_bar/query/query.js +17 -0
  157. package/optimize/es/components/text/text.styles.js +6 -3
  158. package/optimize/es/components/tool_tip/tool_tip.styles.js +7 -6
  159. package/optimize/es/components/tour/tour.styles.js +11 -6
  160. package/optimize/es/global_styling/functions/index.js +1 -0
  161. package/optimize/es/global_styling/functions/math.js +44 -0
  162. package/optimize/es/global_styling/mixins/_helpers.js +5 -2
  163. package/optimize/es/services/color/contrast.js +2 -0
  164. package/optimize/es/services/index.js +1 -1
  165. package/optimize/es/services/theme/context.js +2 -1
  166. package/optimize/es/services/theme/hooks.js +27 -1
  167. package/optimize/es/services/theme/index.js +1 -1
  168. package/optimize/es/services/theme/provider.js +14 -1
  169. package/optimize/lib/components/accordion/accordion.js +5 -4
  170. package/optimize/lib/components/accordion/accordion.styles.js +1 -1
  171. package/optimize/lib/components/badge/badge.js +90 -78
  172. package/optimize/lib/components/badge/badge.styles.js +67 -0
  173. package/optimize/lib/components/basic_table/in_memory_table.js +4 -0
  174. package/optimize/lib/components/breadcrumbs/breadcrumb.styles.js +3 -1
  175. package/optimize/lib/components/button/button.js +0 -1
  176. package/optimize/lib/components/button/button_display/_button_display.js +8 -3
  177. package/optimize/lib/components/button/button_display/_button_display.styles.js +2 -2
  178. package/optimize/lib/components/button/button_display/_button_display_content.js +6 -2
  179. package/optimize/lib/components/button/button_display/_button_display_content.styles.js +4 -1
  180. package/optimize/lib/components/button/button_icon/button_icon.js +11 -7
  181. package/optimize/lib/components/card/card.js +2 -2
  182. package/optimize/lib/components/card/card.styles.js +5 -2
  183. package/optimize/lib/components/expression/expression.styles.js +3 -1
  184. package/optimize/lib/components/flyout/flyout.js +27 -47
  185. package/optimize/lib/components/flyout/flyout.styles.js +124 -0
  186. package/optimize/lib/components/flyout/flyout_body.js +16 -6
  187. package/optimize/lib/components/flyout/flyout_body.styles.js +32 -0
  188. package/optimize/lib/components/flyout/flyout_footer.js +10 -1
  189. package/optimize/lib/components/flyout/flyout_footer.styles.js +24 -0
  190. package/optimize/lib/components/flyout/flyout_header.js +11 -4
  191. package/optimize/lib/components/flyout/flyout_header.styles.js +31 -0
  192. package/optimize/lib/components/image/image_wrapper.js +3 -3
  193. package/optimize/lib/components/markdown_editor/markdown_format.styles.js +10 -5
  194. package/optimize/lib/components/page/page_header/page_header_content.js +1 -1
  195. package/optimize/lib/components/page/page_section/page_section.js +3 -4
  196. package/optimize/lib/components/pagination/pagination_button.styles.js +4 -2
  197. package/optimize/lib/components/popover/popover_title.js +2 -2
  198. package/optimize/lib/components/popover/popover_title.styles.js +19 -7
  199. package/optimize/lib/components/progress/progress.js +2 -2
  200. package/optimize/lib/components/search_bar/filters/custom_component_filter.js +29 -0
  201. package/optimize/lib/components/search_bar/filters/filters.js +7 -0
  202. package/optimize/lib/components/search_bar/query/ast.js +12 -0
  203. package/optimize/lib/components/search_bar/query/ast_to_es_query_dsl.js +16 -11
  204. package/optimize/lib/components/search_bar/query/query.js +17 -0
  205. package/optimize/lib/components/text/text.styles.js +5 -2
  206. package/optimize/lib/components/tool_tip/tool_tip.styles.js +6 -5
  207. package/optimize/lib/components/tour/tour.styles.js +10 -5
  208. package/optimize/lib/global_styling/functions/index.js +13 -0
  209. package/optimize/lib/global_styling/functions/math.js +57 -0
  210. package/optimize/lib/global_styling/mixins/_helpers.js +5 -2
  211. package/optimize/lib/services/color/contrast.js +5 -1
  212. package/optimize/lib/services/index.js +7 -0
  213. package/optimize/lib/services/theme/context.js +4 -2
  214. package/optimize/lib/services/theme/hooks.js +28 -0
  215. package/optimize/lib/services/theme/index.js +12 -0
  216. package/optimize/lib/services/theme/provider.js +23 -9
  217. package/package.json +5 -5
  218. package/src/components/badge/_index.scss +0 -1
  219. package/src/components/index.scss +0 -1
  220. package/src/themes/amsterdam/global_styling/variables/_index.scss +0 -1
  221. package/test-env/components/accordion/accordion.js +5 -4
  222. package/test-env/components/accordion/accordion.styles.js +1 -1
  223. package/test-env/components/badge/badge.js +92 -80
  224. package/test-env/components/badge/badge.styles.js +67 -0
  225. package/test-env/components/basic_table/in_memory_table.js +8 -0
  226. package/test-env/components/breadcrumbs/breadcrumb.styles.js +3 -1
  227. package/test-env/components/button/button.js +0 -1
  228. package/test-env/components/button/button_display/_button_display.js +10 -5
  229. package/test-env/components/button/button_display/_button_display.styles.js +2 -2
  230. package/test-env/components/button/button_display/_button_display_content.js +8 -4
  231. package/test-env/components/button/button_display/_button_display_content.styles.js +4 -1
  232. package/test-env/components/button/button_icon/button_icon.js +11 -7
  233. package/test-env/components/card/card.js +2 -2
  234. package/test-env/components/card/card.styles.js +5 -2
  235. package/test-env/components/collapsible_nav/collapsible_nav.js +8 -0
  236. package/test-env/components/expression/expression.styles.js +3 -1
  237. package/test-env/components/flyout/flyout.styles.js +124 -0
  238. package/test-env/components/flyout/flyout_body.js +16 -6
  239. package/test-env/components/flyout/flyout_body.styles.js +32 -0
  240. package/test-env/components/flyout/flyout_footer.js +10 -1
  241. package/test-env/components/flyout/flyout_footer.styles.js +24 -0
  242. package/test-env/components/flyout/flyout_header.js +11 -4
  243. package/test-env/components/flyout/flyout_header.styles.js +31 -0
  244. package/test-env/components/image/image_wrapper.js +3 -3
  245. package/test-env/components/markdown_editor/markdown_format.styles.js +10 -5
  246. package/test-env/components/notification/notification_event.js +1 -1
  247. package/test-env/components/notification/notification_event_meta.js +1 -1
  248. package/test-env/components/page/page_header/page_header_content.js +1 -1
  249. package/test-env/components/page/page_section/page_section.js +3 -4
  250. package/test-env/components/pagination/pagination_button.styles.js +4 -2
  251. package/test-env/components/popover/popover_title.js +2 -2
  252. package/test-env/components/popover/popover_title.styles.js +19 -7
  253. package/test-env/components/progress/progress.js +2 -2
  254. package/test-env/components/search_bar/filters/custom_component_filter.js +29 -0
  255. package/test-env/components/search_bar/filters/filters.js +7 -0
  256. package/test-env/components/search_bar/query/ast.js +12 -0
  257. package/test-env/components/search_bar/query/ast_to_es_query_dsl.js +16 -11
  258. package/test-env/components/search_bar/query/query.js +17 -0
  259. package/test-env/components/search_bar/search_bar.js +4 -0
  260. package/test-env/components/search_bar/search_filters.js +4 -0
  261. package/test-env/components/selectable/selectable_list/selectable_list.js +2 -2
  262. package/test-env/components/selectable/selectable_list/selectable_list_item.js +2 -2
  263. package/test-env/components/text/text.styles.js +5 -2
  264. package/test-env/components/tool_tip/tool_tip.styles.js +6 -5
  265. package/test-env/components/tour/tour.styles.js +10 -5
  266. package/test-env/global_styling/functions/index.js +13 -0
  267. package/test-env/global_styling/functions/math.js +57 -0
  268. package/test-env/global_styling/mixins/_helpers.js +5 -2
  269. package/test-env/services/color/contrast.js +5 -1
  270. package/test-env/services/index.js +7 -0
  271. package/test-env/services/theme/context.js +4 -2
  272. package/test-env/services/theme/hooks.js +28 -0
  273. package/test-env/services/theme/index.js +12 -0
  274. package/test-env/services/theme/provider.js +23 -9
  275. package/src/components/badge/_badge.scss +0 -133
  276. package/src/components/flyout/_flyout.scss +0 -196
  277. package/src/components/flyout/_flyout_body.scss +0 -18
  278. package/src/components/flyout/_flyout_footer.scss +0 -4
  279. package/src/components/flyout/_flyout_header.scss +0 -7
  280. package/src/components/flyout/_index.scss +0 -7
  281. package/src/components/flyout/_mixins.scss +0 -18
  282. package/src/components/flyout/_variables.scss +0 -8
  283. package/src/themes/amsterdam/global_styling/variables/_flyout.scss +0 -1
@@ -5,7 +5,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.EuiThemeProvider = void 0;
8
+ exports.setEuiDevProviderWarning = exports.getEuiDevProviderWarning = exports.EuiThemeProvider = void 0;
9
9
 
10
10
  var _react = _interopRequireWildcard(require("react"));
11
11
 
@@ -23,6 +23,12 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
23
23
 
24
24
  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; }
25
25
 
26
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
27
+
28
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
29
+
30
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
31
+
26
32
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
27
33
 
28
34
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -35,6 +41,20 @@ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Sy
35
41
 
36
42
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
37
43
 
44
+ var providerWarning = undefined;
45
+
46
+ var setEuiDevProviderWarning = function setEuiDevProviderWarning(level) {
47
+ return providerWarning = level;
48
+ };
49
+
50
+ exports.setEuiDevProviderWarning = setEuiDevProviderWarning;
51
+
52
+ var getEuiDevProviderWarning = function getEuiDevProviderWarning() {
53
+ return providerWarning;
54
+ };
55
+
56
+ exports.getEuiDevProviderWarning = getEuiDevProviderWarning;
57
+
38
58
  var EuiThemeProvider = function EuiThemeProvider(_ref) {
39
59
  var _system = _ref.theme,
40
60
  _colorMode = _ref.colorMode,
@@ -67,7 +87,8 @@ var EuiThemeProvider = function EuiThemeProvider(_ref) {
67
87
  var prevColorMode = (0, _react.useRef)(colorMode);
68
88
  var isParentTheme = (0, _react.useRef)(prevSystemKey.current === parentSystem.key && colorMode === parentColorMode && (0, _isEqual.default)(parentModifications, modifications));
69
89
 
70
- var _useState7 = (0, _react.useState)(isParentTheme.current && Object.keys(parentTheme).length ? parentTheme : (0, _utils.getComputed)(system, (0, _utils.buildTheme)(modifications, "_".concat(system.key)), colorMode)),
90
+ var _useState7 = (0, _react.useState)(isParentTheme.current && Object.keys(parentTheme).length ? _objectSpread({}, parentTheme) // Intentionally create a new object to break referential equality
91
+ : (0, _utils.getComputed)(system, (0, _utils.buildTheme)(modifications, "_".concat(system.key)), colorMode)),
71
92
  _useState8 = _slicedToArray(_useState7, 2),
72
93
  theme = _useState8[0],
73
94
  setTheme = _useState8[1];
@@ -190,10 +190,10 @@ export var EuiAccordionClass = /*#__PURE__*/function (_Component) {
190
190
 
191
191
  if (_arrowDisplay !== 'none') {
192
192
  iconButton = ___EmotionJSX(EuiButtonIcon, _extends({
193
- color: "text"
193
+ color: "text",
194
+ css: cssIconButtonStyles
194
195
  }, arrowProps, {
195
196
  className: iconButtonClasses,
196
- css: cssIconButtonStyles,
197
197
  iconType: "arrowRight",
198
198
  onClick: this.onToggle,
199
199
  "aria-controls": id,
@@ -229,10 +229,11 @@ export var EuiAccordionClass = /*#__PURE__*/function (_Component) {
229
229
  childrenContent = children;
230
230
  }
231
231
 
232
- var button = ___EmotionJSX(ButtonElement, _extends({}, buttonProps, {
232
+ var button = ___EmotionJSX(ButtonElement, _extends({
233
+ css: cssButtonStyles
234
+ }, buttonProps, {
233
235
  id: buttonId,
234
236
  className: buttonClasses,
235
- css: cssButtonStyles,
236
237
  "aria-controls": id,
237
238
  "aria-expanded": isOpen,
238
239
  onClick: isDisabled ? undefined : this.onToggle,
@@ -43,7 +43,7 @@ export var euiAccordionChildrenStyles = function euiAccordionChildrenStyles(_ref
43
43
  export var euiAccordionChildWrapperStyles = function euiAccordionChildWrapperStyles(_ref6) {
44
44
  var euiTheme = _ref6.euiTheme;
45
45
  return {
46
- euiAccordion__childWrapper: /*#__PURE__*/css(logicalCSS('height', 0), " opacity:0;overflow:hidden;transition:", logicals.height, " ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ",opacity ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ";visibility:hidden;will-change:opacity,visibility,", logicals.height, ";&:focus{outline:none;};label:euiAccordion__childWrapper;"),
46
+ euiAccordion__childWrapper: /*#__PURE__*/css(logicalCSS('height', 0), " opacity:0;overflow:hidden;transition:", logicals.height, " ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ",opacity ", euiTheme.animation.normal, " ", euiTheme.animation.resistance, ";visibility:hidden;&:focus{outline:none;};label:euiAccordion__childWrapper;"),
47
47
  isOpen: /*#__PURE__*/css(logicalCSS('height', 'auto'), " opacity:1;visibility:visible;;label:isOpen;")
48
48
  };
49
49
  };
@@ -15,38 +15,22 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
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
- import React from 'react';
18
+ import React, { useMemo } from 'react';
19
19
  import classNames from 'classnames';
20
20
  import chroma from 'chroma-js';
21
- import { keysOf } from '../common';
22
- import { euiPaletteColorBlindBehindText, getSecureRelForTarget, isColorDark } from '../../services';
21
+ import { useEuiTheme, euiPaletteColorBlindBehindText, getSecureRelForTarget, isColorDark, wcagContrastMin } from '../../services';
23
22
  import { EuiInnerText } from '../inner_text';
24
23
  import { EuiIcon } from '../icon';
25
24
  import { chromaValid, parseColor } from '../color_picker/utils';
26
25
  import { validateHref } from '../../services/security/href_validator';
26
+ import { euiBadgeStyles } from './badge.styles';
27
27
  import { jsx as ___EmotionJSX } from "@emotion/react";
28
- // TODO - replace with variables once https://github.com/elastic/eui/issues/2731 is closed
29
- var colorInk = '#000';
30
- var colorGhost = '#fff'; // The color blind palette has some stricter accessibility needs with regards to
28
+ export var ICON_SIDES = ['left', 'right'];
29
+ export var COLORS = ['default', 'hollow', 'primary', 'success', 'accent', 'warning', 'danger'];
30
+ // The color blind palette has some stricter accessibility needs with regards to
31
31
  // charts and contrast. We use the euiPaletteColorBlindBehindText variant here since our
32
32
  // accessibility concerns pertain to foreground (text) and background contrast
33
-
34
33
  var visColors = euiPaletteColorBlindBehindText();
35
- var colorToHexMap = {
36
- // TODO - replace with variable once https://github.com/elastic/eui/issues/2731 is closed
37
- default: '#d3dae6',
38
- primary: visColors[1],
39
- success: visColors[0],
40
- accent: visColors[2],
41
- warning: visColors[5],
42
- danger: visColors[9]
43
- };
44
- export var COLORS = keysOf(colorToHexMap);
45
- var iconSideToClassNameMap = {
46
- left: 'euiBadge--iconLeft',
47
- right: 'euiBadge--iconRight'
48
- };
49
- export var ICON_SIDES = keysOf(iconSideToClassNameMap);
50
34
  export var EuiBadge = function EuiBadge(_ref) {
51
35
  var children = _ref.children,
52
36
  _ref$color = _ref.color,
@@ -67,53 +51,63 @@ export var EuiBadge = function EuiBadge(_ref) {
67
51
  style = _ref.style,
68
52
  rest = _objectWithoutProperties(_ref, _excluded);
69
53
 
54
+ var euiTheme = useEuiTheme();
70
55
  var isHrefValid = !href || validateHref(href);
71
56
  var isDisabled = _isDisabled || !isHrefValid;
72
- var optionalCustomStyles = style;
73
- var textColor = null; // TODO - replace with variable once https://github.com/elastic/eui/issues/2731 is closed
74
-
75
- var wcagContrastBase = 4.5; // WCAG AA contrast level
76
-
77
- var wcagContrast = null;
78
- var colorHex = null; // Check if a valid color name was provided
79
-
80
- try {
81
- if (COLORS.indexOf(color) > -1) {
82
- // Get the hex equivalent for the provided color name
83
- colorHex = colorToHexMap[color]; // Set dark or light text color based upon best contrast
84
-
85
- textColor = setTextColor(colorHex);
86
- optionalCustomStyles = _objectSpread({
87
- backgroundColor: colorHex,
88
- color: textColor
89
- }, optionalCustomStyles);
90
- } else if (color !== 'hollow') {
91
- // This is a custom color that is neither from the base palette nor hollow
92
- // Let's do our best to ensure that it provides sufficient contrast
93
- // Set dark or light text color based upon best contrast
94
- textColor = setTextColor(color); // Check the contrast
95
-
96
- wcagContrast = getColorContrast(textColor, color);
97
-
98
- if (wcagContrast < wcagContrastBase) {
99
- // It's low contrast, so lets show a warning in the console
100
- console.warn('Warning: ', color, ' badge has low contrast of ', wcagContrast.toFixed(2), '. Should be above ', wcagContrastBase, '.');
57
+ var optionalCustomStyles = useMemo(function () {
58
+ var colorToHexMap = {
59
+ default: euiTheme.euiTheme.colors.lightShade,
60
+ hollow: '',
61
+ primary: visColors[1],
62
+ success: visColors[0],
63
+ accent: visColors[2],
64
+ warning: visColors[5],
65
+ danger: visColors[9]
66
+ };
67
+ var textColor = null;
68
+ var contrastRatio = null;
69
+ var colorHex = null;
70
+
71
+ try {
72
+ // Check if a valid color name was provided
73
+ if (COLORS.includes(color)) {
74
+ if (color === 'hollow') return style; // hollow uses its own CSS class
75
+ // Get the hex equivalent for the provided color name
76
+
77
+ colorHex = colorToHexMap[color]; // Set dark or light text color based upon best contrast
78
+
79
+ textColor = setTextColor(euiTheme, colorHex);
80
+ return _objectSpread({
81
+ backgroundColor: colorHex,
82
+ color: textColor
83
+ }, style);
84
+ } else {
85
+ // This is a custom color- let's do our best to ensure that it provides sufficient contrast
86
+ // Set dark or light text color based upon best contrast
87
+ textColor = setTextColor(euiTheme, color); // Check the contrast
88
+
89
+ contrastRatio = getColorContrast(textColor, color);
90
+
91
+ if (contrastRatio < wcagContrastMin) {
92
+ // It's low contrast, so lets show a warning in the console
93
+ console.warn('Warning: ', color, ' badge has low contrast of ', contrastRatio.toFixed(2), '. Should be above ', wcagContrastMin, '.');
94
+ }
95
+
96
+ return _objectSpread({
97
+ backgroundColor: color,
98
+ color: textColor
99
+ }, style);
101
100
  }
102
-
103
- optionalCustomStyles = _objectSpread({
104
- backgroundColor: color,
105
- color: textColor
106
- }, optionalCustomStyles);
101
+ } catch (err) {
102
+ handleInvalidColor(color);
107
103
  }
108
- } catch (err) {
109
- handleInvalidColor(color);
110
- }
111
-
112
- var classes = classNames('euiBadge', {
113
- 'euiBadge-isClickable': (onClick || href) && !iconOnClick,
114
- 'euiBadge-isDisabled': isDisabled,
115
- 'euiBadge--hollow': color === 'hollow'
116
- }, iconSideToClassNameMap[iconSide], className);
104
+ }, [color, style, euiTheme]);
105
+ var styles = euiBadgeStyles(euiTheme);
106
+ var cssStyles = [styles.euiBadge, (onClick || href) && !iconOnClick && styles.clickable, isDisabled && styles.disabled, color === 'hollow' && styles.hollow];
107
+ var textCssStyles = [styles.text.euiBadge__text, (onClick || href) && !isDisabled && styles.text.clickable];
108
+ var iconCssStyles = [styles.icon.euiBadge__icon, styles.icon[iconSide]];
109
+ var iconButtonCssStyles = [styles.iconButton.euiBadge__iconButton, styles.iconButton[iconSide]];
110
+ var classes = classNames('euiBadge', className);
117
111
  var closeClassNames = classNames('euiBadge__icon', closeButtonProps && closeButtonProps.className);
118
112
  var Element = href && !isDisabled ? 'a' : 'button';
119
113
  var relObj = {};
@@ -143,6 +137,7 @@ export var EuiBadge = function EuiBadge(_ref) {
143
137
  optionalIcon = ___EmotionJSX("button", {
144
138
  type: "button",
145
139
  className: "euiBadge__iconButton",
140
+ css: iconButtonCssStyles,
146
141
  "aria-label": iconOnClickAriaLabel,
147
142
  disabled: isDisabled,
148
143
  title: iconOnClickAriaLabel,
@@ -151,7 +146,8 @@ export var EuiBadge = function EuiBadge(_ref) {
151
146
  type: iconType,
152
147
  size: "s",
153
148
  color: "inherit" // forces the icon to inherit its parent color
154
-
149
+ ,
150
+ css: iconCssStyles
155
151
  }, closeButtonProps, {
156
152
  className: closeClassNames
157
153
  })));
@@ -160,6 +156,7 @@ export var EuiBadge = function EuiBadge(_ref) {
160
156
  type: iconType,
161
157
  size: children ? 's' : 'm',
162
158
  className: "euiBadge__icon",
159
+ css: iconCssStyles,
163
160
  color: "inherit" // forces the icon to inherit its parent color
164
161
 
165
162
  });
@@ -171,28 +168,34 @@ export var EuiBadge = function EuiBadge(_ref) {
171
168
  }
172
169
 
173
170
  var content = ___EmotionJSX("span", {
174
- className: "euiBadge__content"
175
- }, children && ___EmotionJSX("span", {
176
- className: "euiBadge__text"
177
- }, children), optionalIcon);
171
+ className: "euiBadge__content",
172
+ css: styles.euiBadge__content
173
+ }, iconSide === 'left' && optionalIcon, children && ___EmotionJSX("span", {
174
+ className: "euiBadge__text",
175
+ css: textCssStyles
176
+ }, children), iconSide === 'right' && optionalIcon);
178
177
 
179
178
  if (iconOnClick) {
180
179
  return onClick || href ? ___EmotionJSX("span", {
181
180
  className: classes,
181
+ css: cssStyles,
182
182
  style: optionalCustomStyles
183
183
  }, ___EmotionJSX("span", {
184
- className: "euiBadge__content"
185
- }, ___EmotionJSX(EuiInnerText, null, function (ref, innerText) {
184
+ className: "euiBadge__content",
185
+ css: styles.euiBadge__content
186
+ }, iconSide === 'left' && optionalIcon, ___EmotionJSX(EuiInnerText, null, function (ref, innerText) {
186
187
  return ___EmotionJSX(Element, _extends({
187
188
  className: "euiBadge__childButton",
189
+ css: styles.euiBadge__childButton,
188
190
  disabled: isDisabled,
189
191
  "aria-label": onClickAriaLabel,
190
192
  ref: ref,
191
193
  title: innerText
192
194
  }, relObj, rest), children);
193
- }), optionalIcon)) : ___EmotionJSX(EuiInnerText, null, function (ref, innerText) {
195
+ }), iconSide === 'right' && optionalIcon)) : ___EmotionJSX(EuiInnerText, null, function (ref, innerText) {
194
196
  return ___EmotionJSX("span", _extends({
195
197
  className: classes,
198
+ css: cssStyles,
196
199
  style: optionalCustomStyles,
197
200
  ref: ref,
198
201
  title: innerText
@@ -204,6 +207,7 @@ export var EuiBadge = function EuiBadge(_ref) {
204
207
  disabled: isDisabled,
205
208
  "aria-label": onClickAriaLabel,
206
209
  className: classes,
210
+ css: cssStyles,
207
211
  style: optionalCustomStyles,
208
212
  ref: ref,
209
213
  title: innerText
@@ -213,6 +217,7 @@ export var EuiBadge = function EuiBadge(_ref) {
213
217
  return ___EmotionJSX(EuiInnerText, null, function (ref, innerText) {
214
218
  return ___EmotionJSX("span", _extends({
215
219
  className: classes,
220
+ css: cssStyles,
216
221
  style: optionalCustomStyles,
217
222
  ref: ref,
218
223
  title: innerText
@@ -226,13 +231,14 @@ function getColorContrast(textColor, color) {
226
231
  return contrastValue;
227
232
  }
228
233
 
229
- function setTextColor(bgColor) {
230
- var textColor = isColorDark.apply(void 0, _toConsumableArray(chroma(bgColor).rgb())) ? colorGhost : colorInk;
234
+ function setTextColor(_ref2, bgColor) {
235
+ var euiTheme = _ref2.euiTheme;
236
+ var textColor = isColorDark.apply(void 0, _toConsumableArray(chroma(bgColor).rgb())) ? euiTheme.colors.ghost : euiTheme.colors.ink;
231
237
  return textColor;
232
238
  }
233
239
 
234
240
  function handleInvalidColor(color) {
235
- var isNamedColor = color && COLORS.includes(color) || color === 'hollow';
241
+ var isNamedColor = COLORS.includes(color);
236
242
  var isValidColorString = color && chromaValid(parseColor(color) || '');
237
243
 
238
244
  if (!isNamedColor && !isValidColorString) {
@@ -0,0 +1,62 @@
1
+ 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)."; }
2
+
3
+ /*
4
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
5
+ * or more contributor license agreements. Licensed under the Elastic License
6
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
7
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
8
+ * Side Public License, v 1.
9
+ */
10
+ import { css } from '@emotion/react';
11
+ import { euiFontSize, euiFocusRing, euiTextTruncate, logicalCSS, logicalTextAlignCSS, mathWithUnits } from '../../global_styling';
12
+ import { euiButtonColor } from '../../themes/amsterdam/global_styling/mixins';
13
+ import { tint, transparentize } from '../../services';
14
+
15
+ var _ref = process.env.NODE_ENV === "production" ? {
16
+ name: "1hw5vc4-clickable",
17
+ styles: "cursor:pointer;label:clickable;"
18
+ } : {
19
+ name: "1hw5vc4-clickable",
20
+ styles: "cursor:pointer;label:clickable;",
21
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
22
+ };
23
+
24
+ export var euiBadgeStyles = function euiBadgeStyles(euiThemeContext) {
25
+ var euiTheme = euiThemeContext.euiTheme,
26
+ colorMode = euiThemeContext.colorMode;
27
+ return {
28
+ euiBadge: /*#__PURE__*/css("display:inline-block;vertical-align:middle;padding:0 ", euiTheme.size.s, ";", logicalCSS('max-width', '100%'), " font-size:", euiFontSize(euiThemeContext, 'xs').fontSize, ";line-height:", euiTheme.base + 2, "px;font-weight:", euiTheme.font.weight.medium, ";white-space:nowrap;text-decoration:none;cursor:default;background-color:transparent;border:", euiTheme.border.width.thin, " solid transparent;border-radius:", mathWithUnits(euiTheme.border.radius.medium, function (x) {
29
+ return x / 2;
30
+ }), ";", logicalTextAlignCSS('left'), " &:focus-within{", euiFocusRing(euiThemeContext), ";}&+.euiBadge{", logicalCSS('margin-left', euiTheme.size.xs), ";};label:euiBadge;"),
31
+ clickable: /*#__PURE__*/css("&:not(:disabled){&:hover,&:focus{text-decoration:underline;}}&:focus{", euiFocusRing(euiThemeContext), ";}&:disabled{cursor:not-allowed;};label:clickable;"),
32
+ disabled: /*#__PURE__*/css("color:", euiButtonColor(euiThemeContext, 'disabled').color, "!important;background-color:", euiButtonColor(euiThemeContext, 'disabled').backgroundColor, "!important;;label:disabled;"),
33
+ // Hollow has a border and is mostly used for autocompleters.
34
+ hollow: /*#__PURE__*/css("background-color:", euiTheme.colors.emptyShade, ";border-color:", colorMode === 'DARK' ? tint(euiTheme.border.color, 0.15) : euiTheme.border.color, ";color:", euiTheme.colors.text, ";;label:hollow;"),
35
+ // Content wrapper
36
+ euiBadge__content: /*#__PURE__*/css(logicalCSS( // Ensure proper height in case of just displaying an icon
37
+ 'min-height', "".concat(mathWithUnits(euiTheme.border.width.thin, function (x) {
38
+ return euiTheme.base + x * 2;
39
+ }))), " display:flex;align-items:center;overflow:hidden;;label:euiBadge__content;"),
40
+ // Text
41
+ text: {
42
+ euiBadge__text: /*#__PURE__*/css(euiTextTruncate(), " cursor:inherit;;label:euiBadge__text;"),
43
+ clickable: _ref
44
+ },
45
+ // Icon
46
+ icon: {
47
+ euiBadge__icon: /*#__PURE__*/css(";label:euiBadge__icon;"),
48
+ right: /*#__PURE__*/css("&:not(:only-child){", logicalCSS('margin-left', euiTheme.size.xs), ";};label:right;"),
49
+ left: /*#__PURE__*/css("&:not(:only-child){", logicalCSS('margin-right', euiTheme.size.xs), ";};label:left;")
50
+ },
51
+ // Clickable icons (iconOnClick)
52
+ iconButton: {
53
+ euiBadge__iconButton: /*#__PURE__*/css("font-size:0;&:focus{background-color:", transparentize(euiTheme.colors.ghost, 0.8), ";color:", euiTheme.colors.ink, ";border-radius:", mathWithUnits(euiTheme.border.radius.small, function (x) {
54
+ return x / 2;
55
+ }), ";}&:disabled{cursor:not-allowed;}.euiBadge__icon{margin:0!important;};label:euiBadge__iconButton;"),
56
+ right: /*#__PURE__*/css(logicalCSS('margin-left', euiTheme.size.xs), ";;label:right;"),
57
+ left: /*#__PURE__*/css(logicalCSS('margin-right', euiTheme.size.xs), ";;label:left;")
58
+ },
59
+ // Used in badges with both onClick & iconOnClick
60
+ euiBadge__childButton: /*#__PURE__*/css(euiTextTruncate(), " text-align:inherit;font-weight:inherit;line-height:inherit;color:inherit;&:disabled{cursor:not-allowed;}&:not(:disabled){&:hover,&:focus{text-decoration:underline;}};label:euiBadge__childButton;")
61
+ };
62
+ };
@@ -523,6 +523,10 @@ export var EuiInMemoryTable = /*#__PURE__*/function (_Component) {
523
523
 
524
524
  if (sortName !== prevState.prevProps.sortName || sortDirection !== prevState.prevProps.sortDirection) {
525
525
  updatedPrevState = _objectSpread(_objectSpread({}, updatedPrevState), {}, {
526
+ prevProps: _objectSpread(_objectSpread({}, updatedPrevState.prevProps), {}, {
527
+ sortName: sortName,
528
+ sortDirection: sortDirection
529
+ }),
526
530
  sortName: sortName,
527
531
  sortDirection: sortDirection
528
532
  });
@@ -9,7 +9,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
9
9
  */
10
10
  import { css } from '@emotion/react';
11
11
  import { transparentize } from '../../services/color';
12
- import { euiFontSize, euiTextTruncate, euiFocusRing, logicalCSS } from '../../global_styling';
12
+ import { euiFontSize, euiTextTruncate, euiFocusRing, logicalCSS, mathWithUnits } from '../../global_styling';
13
13
 
14
14
  var _ref = process.env.NODE_ENV === "production" ? {
15
15
  name: "1k7t4ns-isCollapsed",
@@ -47,7 +47,9 @@ export var euiBreadcrumbContentStyles = function euiBreadcrumbContentStyles(euiT
47
47
  var euiTheme = euiThemeContext.euiTheme;
48
48
  return {
49
49
  euiBreadcrumb__content: /*#__PURE__*/css("font-weight:", euiTheme.font.weight.medium, ";text-align:center;vertical-align:baseline;;label:euiBreadcrumb__content;"),
50
- isTruncated: /*#__PURE__*/css(euiTextTruncate("".concat(parseFloat(euiTheme.size.base) * 10, "px")), ";;label:isTruncated;"),
50
+ isTruncated: /*#__PURE__*/css(euiTextTruncate(mathWithUnits(euiTheme.size.base, function (x) {
51
+ return x * 10;
52
+ })), ";;label:isTruncated;"),
51
53
  isTruncatedLast: /*#__PURE__*/css(euiTextTruncate('none'), ";;label:isTruncatedLast;"),
52
54
  // Types
53
55
  page: /*#__PURE__*/css("&:is(a):focus{", euiFocusRing(euiThemeContext, 'inset'), ";}&:is(button):focus{", euiFocusRing(euiThemeContext, 'center'), ";};label:page;"),
@@ -68,7 +68,6 @@ export var EuiButton = function EuiButton(props) {
68
68
  EuiButton.displayName = 'EuiButton'; // Use defaultProps for simple pass-through props
69
69
 
70
70
  EuiButton.defaultProps = {
71
- minWidth: 112,
72
71
  size: 'm',
73
72
  color: 'primary'
74
73
  };
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
- var _excluded = ["children", "iconType", "iconSide", "size", "isDisabled", "disabled", "isLoading", "isSelected", "fullWidth", "minWidth", "contentProps", "textProps", "href", "target", "rel", "type"];
4
+ var _excluded = ["children", "iconType", "iconSide", "iconSize", "size", "isDisabled", "disabled", "isLoading", "isSelected", "fullWidth", "minWidth", "contentProps", "textProps", "href", "target", "rel", "type", "style"];
5
5
 
6
6
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
7
7
 
@@ -40,6 +40,7 @@ export var EuiButtonDisplay = /*#__PURE__*/forwardRef(function (_ref2, ref) {
40
40
  var children = _ref2.children,
41
41
  iconType = _ref2.iconType,
42
42
  iconSide = _ref2.iconSide,
43
+ iconSize = _ref2.iconSize,
43
44
  _ref2$size = _ref2.size,
44
45
  size = _ref2$size === void 0 ? 'm' : _ref2$size,
45
46
  isDisabled = _ref2.isDisabled,
@@ -55,6 +56,7 @@ export var EuiButtonDisplay = /*#__PURE__*/forwardRef(function (_ref2, ref) {
55
56
  rel = _ref2.rel,
56
57
  _ref2$type = _ref2.type,
57
58
  type = _ref2$type === void 0 ? 'button' : _ref2$type,
59
+ style = _ref2.style,
58
60
  rest = _objectWithoutProperties(_ref2, _excluded);
59
61
 
60
62
  var buttonIsDisabled = isButtonDisabled({
@@ -62,9 +64,8 @@ export var EuiButtonDisplay = /*#__PURE__*/forwardRef(function (_ref2, ref) {
62
64
  isDisabled: isDisabled || disabled,
63
65
  isLoading: isLoading
64
66
  });
65
- var minWidthPx = typeof minWidth === 'number' ? "".concat(minWidth, "px") : minWidth;
66
67
  var theme = useEuiTheme();
67
- var styles = euiButtonDisplayStyles(theme, minWidthPx);
68
+ var styles = euiButtonDisplayStyles(theme);
68
69
  var buttonRadiusStyle = useEuiButtonRadiusCSS()[size];
69
70
  var cssStyles = [styles.euiButtonDisplay, styles[size], fullWidth && styles.fullWidth, buttonIsDisabled && styles.isDisabled, buttonRadiusStyle];
70
71
 
@@ -73,6 +74,7 @@ export var EuiButtonDisplay = /*#__PURE__*/forwardRef(function (_ref2, ref) {
73
74
  isDisabled: buttonIsDisabled,
74
75
  iconType: iconType,
75
76
  iconSide: iconSide,
77
+ iconSize: iconSize,
76
78
  textProps: _objectSpread({}, textProps)
77
79
  }, contentProps), children);
78
80
 
@@ -102,6 +104,9 @@ export var EuiButtonDisplay = /*#__PURE__*/forwardRef(function (_ref2, ref) {
102
104
 
103
105
  return createElement(element, _objectSpread(_objectSpread(_objectSpread({
104
106
  css: cssStyles,
107
+ style: minWidth ? _objectSpread(_objectSpread({}, style), {}, {
108
+ minWidth: minWidth
109
+ }) : style,
105
110
  ref: ref
106
111
  }, elementProps), relObj), rest), innerNode);
107
112
  });
@@ -28,11 +28,11 @@ var _ref = process.env.NODE_ENV === "production" ? {
28
28
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
29
29
  };
30
30
 
31
- export var euiButtonDisplayStyles = function euiButtonDisplayStyles(euiThemeContext, minWidth) {
31
+ export var euiButtonDisplayStyles = function euiButtonDisplayStyles(euiThemeContext) {
32
32
  var euiTheme = euiThemeContext.euiTheme;
33
33
  return {
34
34
  // Base
35
- euiButtonDisplay: /*#__PURE__*/css(euiButtonBaseCSS(), ";", minWidth && logicalCSS('min-width', minWidth), ";font-weight:", euiTheme.font.weight.medium, ";padding:0 ", euiTheme.size.m, ";&:hover:not(:disabled),&:focus{text-decoration:underline;};label:euiButtonDisplay;"),
35
+ euiButtonDisplay: /*#__PURE__*/css(euiButtonBaseCSS(), ";", logicalCSS('min-width', "".concat(euiTheme.base * 7, "px")), " font-weight:", euiTheme.font.weight.medium, ";padding:0 ", euiTheme.size.m, ";&:hover:not(:disabled),&:focus{text-decoration:underline;};label:euiButtonDisplay;"),
36
36
  // States
37
37
  isDisabled: _ref,
38
38
  fullWidth: /*#__PURE__*/css("display:block;", logicalCSS('width', '100%'), ";;label:fullWidth;"),
@@ -16,6 +16,8 @@ import { EuiIcon } from '../../icon';
16
16
  import { euiButtonDisplayContentStyles } from './_button_display_content.styles';
17
17
  import classNames from 'classnames';
18
18
  import { jsx as ___EmotionJSX } from "@emotion/react";
19
+ export var ICON_SIZES = ['s', 'm'];
20
+ export var ICON_SIDES = ['left', 'right'];
19
21
  export var EuiButtonDisplayContent = function EuiButtonDisplayContent(_ref) {
20
22
  var children = _ref.children,
21
23
  textProps = _ref.textProps,
@@ -33,7 +35,7 @@ export var EuiButtonDisplayContent = function EuiButtonDisplayContent(_ref) {
33
35
  var styles = euiButtonDisplayContentStyles(theme);
34
36
  var cssStyles = [styles.euiButtonDisplayContent, iconSide && styles[iconSide]];
35
37
  var cssSpinnerStyles = [styles.euiButtonDisplayContent__spinner];
36
- var cssIconStyles = [styles.euiButtonDisplayContent__icon]; // Add an icon to the button if one exists.
38
+ var cssIconStyles = [styles.euiButtonDisplayContent__icon, iconSize && styles[iconSize]]; // Add an icon to the button if one exists.
37
39
 
38
40
  var icon; // When the button is disabled the text gets gray
39
41
  // and in some buttons the background gets a light gray
@@ -46,6 +46,9 @@ export var euiButtonDisplayContentStyles = function euiButtonDisplayContentStyle
46
46
  left: /*#__PURE__*/css(";label:left;"),
47
47
  right: _ref3,
48
48
  euiButtonDisplayContent__spinner: _ref2,
49
- euiButtonDisplayContent__icon: _ref
49
+ euiButtonDisplayContent__icon: _ref,
50
+ // Icon size
51
+ s: /*#__PURE__*/css(";label:s;"),
52
+ m: /*#__PURE__*/css(";label:m;")
50
53
  };
51
54
  };
@@ -69,11 +69,15 @@ export var EuiButtonIcon = function EuiButtonIcon(props) {
69
69
 
70
70
 
71
71
  var color = isDisabled ? 'disabled' : _color === 'ghost' ? 'text' : _color;
72
- var buttonColorStyles = useEuiButtonColorCSS({
73
- display: display
74
- })[color]; // Temporary extra style for empty `:hover` state until we decide how to handle universally
75
-
76
- var hoverStyles = display === 'empty' ? /*#__PURE__*/css("&:hover{background-color:", euiButtonEmptyColor(euiThemeContext, color).backgroundColor, ";};label:hoverStyles;") : /*#__PURE__*/css(";label:hoverStyles;");
72
+ var styles = {
73
+ euiButtonIcon: /*#__PURE__*/css(";label:euiButtonIcon;"),
74
+ colors: useEuiButtonColorCSS({
75
+ display: display
76
+ }),
77
+ // Temporary extra style for empty `:hover` state until we decide how to handle universally
78
+ hoverStyles: /*#__PURE__*/css("&:hover{background-color:", euiButtonEmptyColor(euiThemeContext, color).backgroundColor, ";};label:hoverStyles;")
79
+ };
80
+ var cssStyles = [styles.euiButtonIcon, styles.colors[color], display === 'empty' && styles.hoverStyles];
77
81
  var classes = classNames('euiButtonIcon', size && sizeToClassNameMap[size], className);
78
82
 
79
83
  if (_color === 'ghost') {
@@ -119,7 +123,7 @@ export var EuiButtonIcon = function EuiButtonIcon(props) {
119
123
  rel: rel
120
124
  });
121
125
  return ___EmotionJSX("a", _extends({
122
- css: [buttonColorStyles, hoverStyles, ";label:EuiButtonIcon;"],
126
+ css: cssStyles,
123
127
  tabIndex: isAriaHidden ? -1 : undefined,
124
128
  className: classes,
125
129
  href: href,
@@ -131,7 +135,7 @@ export var EuiButtonIcon = function EuiButtonIcon(props) {
131
135
 
132
136
  var buttonType;
133
137
  return ___EmotionJSX("button", _extends({
134
- css: [buttonColorStyles, hoverStyles, ";label:EuiButtonIcon;"],
138
+ css: cssStyles,
135
139
  tabIndex: isAriaHidden ? -1 : undefined,
136
140
  disabled: isDisabled,
137
141
  className: classes,
@@ -76,7 +76,7 @@ export var EuiCard = function EuiCard(_ref) {
76
76
  var isDisabled = _isDisabled || !isHrefValid;
77
77
  var isClickable = !isDisabled && (onClick || href || selectable && !selectable.isDisabled);
78
78
  var euiThemeContext = useEuiTheme();
79
- var styles = euiCardStyles(euiThemeContext, paddingSize, display);
79
+ var styles = euiCardStyles(euiThemeContext, paddingSize);
80
80
  var cardStyles = [styles.card.euiCard, // Text alignment should always be left when horizontal
81
81
  styles.card.aligned[layout === 'horizontal' ? 'left' : textAlign], styles.card.layout[layout], isDisabled && styles.card.disabled];
82
82
  var contentStyles = [styles.content.euiCard__content, styles.content.layout[layout]];
@@ -122,7 +122,7 @@ export var EuiCard = function EuiCard(_ref) {
122
122
 
123
123
  if (image && layout === 'vertical') {
124
124
  if ( /*#__PURE__*/isValidElement(image) || typeof image === 'string') {
125
- var imageStyles = [styles.euiCard__image];
125
+ var imageStyles = [styles.image.euiCard__image, display === 'transparent' && styles.image.transparent];
126
126
  imageNode = ___EmotionJSX("div", {
127
127
  className: "euiCard__image",
128
128
  css: imageStyles
@@ -54,7 +54,7 @@ var _ref5 = process.env.NODE_ENV === "production" ? {
54
54
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
55
55
  };
56
56
 
57
- export var euiCardStyles = function euiCardStyles(euiThemeContext, paddingSize, color) {
57
+ export var euiCardStyles = function euiCardStyles(euiThemeContext, paddingSize) {
58
58
  var euiTheme = euiThemeContext.euiTheme;
59
59
  var paddingAmount = euiPaddingSize(euiThemeContext, paddingSize);
60
60
  var spacing = euiPaddingSize(euiThemeContext, paddingKey);
@@ -91,7 +91,10 @@ export var euiCardStyles = function euiCardStyles(euiThemeContext, paddingSize,
91
91
  },
92
92
  disabled: _ref2
93
93
  },
94
- euiCard__image: /*#__PURE__*/css("position:relative;overflow:hidden;", logicalCSS('width', "calc(100% + (".concat(paddingAmount, " * 2))")), ";", logicalCSS('left', "-".concat(paddingAmount)), ";", logicalCSS('top', "-".concat(paddingAmount)), ";", logicalCSS('margin-bottom', "-".concat(paddingAmount)), ";", logicalCSS('border-top-left-radius', "calc(".concat(euiTheme.border.radius.medium, " - ").concat(euiTheme.border.width.thin, ")")), " ", logicals['border-top-right-radius'], ":calc(", euiTheme.border.radius.medium, " - ", euiTheme.border.width.thin, ");", color === 'transparent' ? "border-radius: ".concat(euiTheme.border.radius.medium, ";") : undefined, " img{", logicalCSS('width', '100%'), ";};label:euiCard__image;"),
94
+ image: {
95
+ euiCard__image: /*#__PURE__*/css("position:relative;overflow:hidden;", logicalCSS('width', "calc(100% + (".concat(paddingAmount, " * 2))")), ";", logicalCSS('left', "-".concat(paddingAmount)), ";", logicalCSS('top', "-".concat(paddingAmount)), ";", logicalCSS('margin-bottom', "-".concat(paddingAmount)), ";", logicalCSS('border-top-left-radius', "calc(".concat(euiTheme.border.radius.medium, " - ").concat(euiTheme.border.width.thin, ")")), " ", logicals['border-top-right-radius'], ":calc(", euiTheme.border.radius.medium, " - ", euiTheme.border.width.thin, ");img{", logicalCSS('width', '100%'), ";};label:euiCard__image;"),
96
+ transparent: /*#__PURE__*/css("border-radius:", euiTheme.border.radius.medium, ";;label:transparent;")
97
+ },
95
98
  icon: {
96
99
  euiCard__icon: /*#__PURE__*/css(";label:euiCard__icon;"),
97
100
  withImage: /*#__PURE__*/css("position:absolute;", logicalCSS('top', '50%'), ";", logicalCSS('left', '50%'), ";transform:translate(-50%, calc(-50% + -", paddingAmount, "))!important;;label:withImage;"),