@elastic/eui 67.0.0 → 67.1.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 (141) hide show
  1. package/dist/eui_theme_dark.css +0 -98
  2. package/dist/eui_theme_dark.min.css +1 -1
  3. package/dist/eui_theme_light.css +0 -98
  4. package/dist/eui_theme_light.min.css +1 -1
  5. package/es/components/badge/badge.js +84 -78
  6. package/es/components/badge/badge.styles.js +56 -0
  7. package/es/components/basic_table/in_memory_table.js +8 -0
  8. package/es/components/button/button.js +0 -1
  9. package/es/components/button/button_display/_button_display.js +10 -5
  10. package/es/components/button/button_display/_button_display.styles.js +2 -2
  11. package/es/components/button/button_display/_button_display_content.js +5 -3
  12. package/es/components/button/button_display/_button_display_content.styles.js +4 -1
  13. package/es/components/card/card.js +2 -2
  14. package/es/components/card/card.styles.js +5 -2
  15. package/es/components/notification/notification_event.js +1 -1
  16. package/es/components/notification/notification_event_meta.js +1 -1
  17. package/es/components/popover/popover_title.js +2 -2
  18. package/es/components/popover/popover_title.styles.js +18 -6
  19. package/es/components/search_bar/filters/custom_component_filter.js +16 -0
  20. package/es/components/search_bar/filters/filters.js +6 -0
  21. package/es/components/search_bar/query/ast.js +12 -0
  22. package/es/components/search_bar/query/ast_to_es_query_dsl.js +15 -10
  23. package/es/components/search_bar/query/query.js +17 -0
  24. package/es/components/search_bar/search_bar.js +4 -0
  25. package/es/components/search_bar/search_filters.js +4 -0
  26. package/es/components/selectable/selectable_list/selectable_list.js +2 -2
  27. package/es/components/selectable/selectable_list/selectable_list_item.js +2 -2
  28. package/es/services/color/contrast.js +2 -0
  29. package/es/services/index.js +1 -1
  30. package/es/services/theme/context.js +2 -1
  31. package/es/services/theme/hooks.js +27 -1
  32. package/es/services/theme/index.js +1 -1
  33. package/es/services/theme/provider.js +15 -1
  34. package/eui.d.ts +104 -28
  35. package/lib/components/badge/badge.js +92 -80
  36. package/lib/components/badge/badge.styles.js +61 -0
  37. package/lib/components/basic_table/in_memory_table.js +8 -0
  38. package/lib/components/button/button.js +0 -1
  39. package/lib/components/button/button_display/_button_display.js +10 -5
  40. package/lib/components/button/button_display/_button_display.styles.js +2 -2
  41. package/lib/components/button/button_display/_button_display_content.js +9 -4
  42. package/lib/components/button/button_display/_button_display_content.styles.js +4 -1
  43. package/lib/components/card/card.js +2 -2
  44. package/lib/components/card/card.styles.js +5 -2
  45. package/lib/components/notification/notification_event.js +1 -1
  46. package/lib/components/notification/notification_event_meta.js +1 -1
  47. package/lib/components/popover/popover_title.js +2 -2
  48. package/lib/components/popover/popover_title.styles.js +19 -7
  49. package/lib/components/search_bar/filters/custom_component_filter.js +29 -0
  50. package/lib/components/search_bar/filters/filters.js +7 -0
  51. package/lib/components/search_bar/query/ast.js +12 -0
  52. package/lib/components/search_bar/query/ast_to_es_query_dsl.js +16 -11
  53. package/lib/components/search_bar/query/query.js +17 -0
  54. package/lib/components/search_bar/search_bar.js +4 -0
  55. package/lib/components/search_bar/search_filters.js +4 -0
  56. package/lib/components/selectable/selectable_list/selectable_list.js +2 -2
  57. package/lib/components/selectable/selectable_list/selectable_list_item.js +2 -2
  58. package/lib/services/color/contrast.js +6 -1
  59. package/lib/services/index.js +7 -0
  60. package/lib/services/theme/context.js +4 -2
  61. package/lib/services/theme/hooks.js +28 -0
  62. package/lib/services/theme/index.js +12 -0
  63. package/lib/services/theme/provider.js +23 -2
  64. package/optimize/es/components/badge/badge.js +82 -76
  65. package/optimize/es/components/badge/badge.styles.js +56 -0
  66. package/optimize/es/components/basic_table/in_memory_table.js +4 -0
  67. package/optimize/es/components/button/button.js +0 -1
  68. package/optimize/es/components/button/button_display/_button_display.js +8 -3
  69. package/optimize/es/components/button/button_display/_button_display.styles.js +2 -2
  70. package/optimize/es/components/button/button_display/_button_display_content.js +3 -1
  71. package/optimize/es/components/button/button_display/_button_display_content.styles.js +4 -1
  72. package/optimize/es/components/card/card.js +2 -2
  73. package/optimize/es/components/card/card.styles.js +5 -2
  74. package/optimize/es/components/popover/popover_title.js +2 -2
  75. package/optimize/es/components/popover/popover_title.styles.js +18 -6
  76. package/optimize/es/components/search_bar/filters/custom_component_filter.js +16 -0
  77. package/optimize/es/components/search_bar/filters/filters.js +6 -0
  78. package/optimize/es/components/search_bar/query/ast.js +12 -0
  79. package/optimize/es/components/search_bar/query/ast_to_es_query_dsl.js +14 -9
  80. package/optimize/es/components/search_bar/query/query.js +17 -0
  81. package/optimize/es/services/color/contrast.js +2 -0
  82. package/optimize/es/services/index.js +1 -1
  83. package/optimize/es/services/theme/context.js +2 -1
  84. package/optimize/es/services/theme/hooks.js +27 -1
  85. package/optimize/es/services/theme/index.js +1 -1
  86. package/optimize/es/services/theme/provider.js +14 -1
  87. package/optimize/lib/components/badge/badge.js +90 -78
  88. package/optimize/lib/components/badge/badge.styles.js +61 -0
  89. package/optimize/lib/components/basic_table/in_memory_table.js +4 -0
  90. package/optimize/lib/components/button/button.js +0 -1
  91. package/optimize/lib/components/button/button_display/_button_display.js +8 -3
  92. package/optimize/lib/components/button/button_display/_button_display.styles.js +2 -2
  93. package/optimize/lib/components/button/button_display/_button_display_content.js +6 -2
  94. package/optimize/lib/components/button/button_display/_button_display_content.styles.js +4 -1
  95. package/optimize/lib/components/card/card.js +2 -2
  96. package/optimize/lib/components/card/card.styles.js +5 -2
  97. package/optimize/lib/components/popover/popover_title.js +2 -2
  98. package/optimize/lib/components/popover/popover_title.styles.js +19 -7
  99. package/optimize/lib/components/search_bar/filters/custom_component_filter.js +29 -0
  100. package/optimize/lib/components/search_bar/filters/filters.js +7 -0
  101. package/optimize/lib/components/search_bar/query/ast.js +12 -0
  102. package/optimize/lib/components/search_bar/query/ast_to_es_query_dsl.js +16 -11
  103. package/optimize/lib/components/search_bar/query/query.js +17 -0
  104. package/optimize/lib/services/color/contrast.js +5 -1
  105. package/optimize/lib/services/index.js +7 -0
  106. package/optimize/lib/services/theme/context.js +4 -2
  107. package/optimize/lib/services/theme/hooks.js +28 -0
  108. package/optimize/lib/services/theme/index.js +12 -0
  109. package/optimize/lib/services/theme/provider.js +23 -9
  110. package/package.json +5 -5
  111. package/src/components/badge/_index.scss +0 -1
  112. package/test-env/components/badge/badge.js +92 -80
  113. package/test-env/components/badge/badge.styles.js +61 -0
  114. package/test-env/components/basic_table/in_memory_table.js +8 -0
  115. package/test-env/components/button/button.js +0 -1
  116. package/test-env/components/button/button_display/_button_display.js +10 -5
  117. package/test-env/components/button/button_display/_button_display.styles.js +2 -2
  118. package/test-env/components/button/button_display/_button_display_content.js +8 -4
  119. package/test-env/components/button/button_display/_button_display_content.styles.js +4 -1
  120. package/test-env/components/card/card.js +2 -2
  121. package/test-env/components/card/card.styles.js +5 -2
  122. package/test-env/components/notification/notification_event.js +1 -1
  123. package/test-env/components/notification/notification_event_meta.js +1 -1
  124. package/test-env/components/popover/popover_title.js +2 -2
  125. package/test-env/components/popover/popover_title.styles.js +19 -7
  126. package/test-env/components/search_bar/filters/custom_component_filter.js +29 -0
  127. package/test-env/components/search_bar/filters/filters.js +7 -0
  128. package/test-env/components/search_bar/query/ast.js +12 -0
  129. package/test-env/components/search_bar/query/ast_to_es_query_dsl.js +16 -11
  130. package/test-env/components/search_bar/query/query.js +17 -0
  131. package/test-env/components/search_bar/search_bar.js +4 -0
  132. package/test-env/components/search_bar/search_filters.js +4 -0
  133. package/test-env/components/selectable/selectable_list/selectable_list.js +2 -2
  134. package/test-env/components/selectable/selectable_list/selectable_list_item.js +2 -2
  135. package/test-env/services/color/contrast.js +5 -1
  136. package/test-env/services/index.js +7 -0
  137. package/test-env/services/theme/context.js +4 -2
  138. package/test-env/services/theme/hooks.js +28 -0
  139. package/test-env/services/theme/index.js +12 -0
  140. package/test-env/services/theme/provider.js +23 -9
  141. package/src/components/badge/_badge.scss +0 -133
@@ -1,11 +1,13 @@
1
1
  "use strict";
2
2
 
3
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
+
3
5
  Object.defineProperty(exports, "__esModule", {
4
6
  value: true
5
7
  });
6
8
  exports.ICON_SIDES = exports.EuiBadge = exports.COLORS = void 0;
7
9
 
8
- var _react = _interopRequireDefault(require("react"));
10
+ var _react = _interopRequireWildcard(require("react"));
9
11
 
10
12
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
13
 
@@ -13,8 +15,6 @@ var _classnames = _interopRequireDefault(require("classnames"));
13
15
 
14
16
  var _chromaJs = _interopRequireDefault(require("chroma-js"));
15
17
 
16
- var _common = require("../common");
17
-
18
18
  var _services = require("../../services");
19
19
 
20
20
  var _inner_text = require("../inner_text");
@@ -25,12 +25,18 @@ var _utils = require("../color_picker/utils");
25
25
 
26
26
  var _href_validator = require("../../services/security/href_validator");
27
27
 
28
+ var _badge = require("./badge.styles");
29
+
28
30
  var _react2 = require("@emotion/react");
29
31
 
30
32
  var _excluded = ["children", "color", "iconType", "iconSide", "className", "isDisabled", "onClick", "iconOnClick", "onClickAriaLabel", "iconOnClickAriaLabel", "closeButtonProps", "href", "rel", "target", "style"];
31
33
 
32
34
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
33
35
 
36
+ 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); }
37
+
38
+ 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; }
39
+
34
40
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
35
41
 
36
42
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -55,30 +61,14 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
55
61
 
56
62
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
57
63
 
58
- // TODO - replace with variables once https://github.com/elastic/eui/issues/2731 is closed
59
- var colorInk = '#000';
60
- var colorGhost = '#fff'; // The color blind palette has some stricter accessibility needs with regards to
64
+ var ICON_SIDES = ['left', 'right'];
65
+ exports.ICON_SIDES = ICON_SIDES;
66
+ var COLORS = ['default', 'hollow', 'primary', 'success', 'accent', 'warning', 'danger'];
67
+ exports.COLORS = COLORS;
68
+ // The color blind palette has some stricter accessibility needs with regards to
61
69
  // charts and contrast. We use the euiPaletteColorBlindBehindText variant here since our
62
70
  // accessibility concerns pertain to foreground (text) and background contrast
63
-
64
71
  var visColors = (0, _services.euiPaletteColorBlindBehindText)();
65
- var colorToHexMap = {
66
- // TODO - replace with variable once https://github.com/elastic/eui/issues/2731 is closed
67
- default: '#d3dae6',
68
- primary: visColors[1],
69
- success: visColors[0],
70
- accent: visColors[2],
71
- warning: visColors[5],
72
- danger: visColors[9]
73
- };
74
- var COLORS = (0, _common.keysOf)(colorToHexMap);
75
- exports.COLORS = COLORS;
76
- var iconSideToClassNameMap = {
77
- left: 'euiBadge--iconLeft',
78
- right: 'euiBadge--iconRight'
79
- };
80
- var ICON_SIDES = (0, _common.keysOf)(iconSideToClassNameMap);
81
- exports.ICON_SIDES = ICON_SIDES;
82
72
 
83
73
  var EuiBadge = function EuiBadge(_ref) {
84
74
  var children = _ref.children,
@@ -100,53 +90,63 @@ var EuiBadge = function EuiBadge(_ref) {
100
90
  style = _ref.style,
101
91
  rest = _objectWithoutProperties(_ref, _excluded);
102
92
 
93
+ var euiTheme = (0, _services.useEuiTheme)();
103
94
  var isHrefValid = !href || (0, _href_validator.validateHref)(href);
104
95
  var isDisabled = _isDisabled || !isHrefValid;
105
- var optionalCustomStyles = style;
106
- var textColor = null; // TODO - replace with variable once https://github.com/elastic/eui/issues/2731 is closed
107
-
108
- var wcagContrastBase = 4.5; // WCAG AA contrast level
109
-
110
- var wcagContrast = null;
111
- var colorHex = null; // Check if a valid color name was provided
112
-
113
- try {
114
- if (COLORS.indexOf(color) > -1) {
115
- // Get the hex equivalent for the provided color name
116
- colorHex = colorToHexMap[color]; // Set dark or light text color based upon best contrast
117
-
118
- textColor = setTextColor(colorHex);
119
- optionalCustomStyles = _objectSpread({
120
- backgroundColor: colorHex,
121
- color: textColor
122
- }, optionalCustomStyles);
123
- } else if (color !== 'hollow') {
124
- // This is a custom color that is neither from the base palette nor hollow
125
- // Let's do our best to ensure that it provides sufficient contrast
126
- // Set dark or light text color based upon best contrast
127
- textColor = setTextColor(color); // Check the contrast
128
-
129
- wcagContrast = getColorContrast(textColor, color);
130
-
131
- if (wcagContrast < wcagContrastBase) {
132
- // It's low contrast, so lets show a warning in the console
133
- console.warn('Warning: ', color, ' badge has low contrast of ', wcagContrast.toFixed(2), '. Should be above ', wcagContrastBase, '.');
96
+ var optionalCustomStyles = (0, _react.useMemo)(function () {
97
+ var colorToHexMap = {
98
+ default: euiTheme.euiTheme.colors.lightShade,
99
+ hollow: '',
100
+ primary: visColors[1],
101
+ success: visColors[0],
102
+ accent: visColors[2],
103
+ warning: visColors[5],
104
+ danger: visColors[9]
105
+ };
106
+ var textColor = null;
107
+ var contrastRatio = null;
108
+ var colorHex = null;
109
+
110
+ try {
111
+ // Check if a valid color name was provided
112
+ if (COLORS.includes(color)) {
113
+ if (color === 'hollow') return style; // hollow uses its own CSS class
114
+ // Get the hex equivalent for the provided color name
115
+
116
+ colorHex = colorToHexMap[color]; // Set dark or light text color based upon best contrast
117
+
118
+ textColor = setTextColor(euiTheme, colorHex);
119
+ return _objectSpread({
120
+ backgroundColor: colorHex,
121
+ color: textColor
122
+ }, style);
123
+ } else {
124
+ // This is a custom color- let's do our best to ensure that it provides sufficient contrast
125
+ // Set dark or light text color based upon best contrast
126
+ textColor = setTextColor(euiTheme, color); // Check the contrast
127
+
128
+ contrastRatio = getColorContrast(textColor, color);
129
+
130
+ if (contrastRatio < _services.wcagContrastMin) {
131
+ // It's low contrast, so lets show a warning in the console
132
+ console.warn('Warning: ', color, ' badge has low contrast of ', contrastRatio.toFixed(2), '. Should be above ', _services.wcagContrastMin, '.');
133
+ }
134
+
135
+ return _objectSpread({
136
+ backgroundColor: color,
137
+ color: textColor
138
+ }, style);
134
139
  }
135
-
136
- optionalCustomStyles = _objectSpread({
137
- backgroundColor: color,
138
- color: textColor
139
- }, optionalCustomStyles);
140
+ } catch (err) {
141
+ handleInvalidColor(color);
140
142
  }
141
- } catch (err) {
142
- handleInvalidColor(color);
143
- }
144
-
145
- var classes = (0, _classnames.default)('euiBadge', {
146
- 'euiBadge-isClickable': (onClick || href) && !iconOnClick,
147
- 'euiBadge-isDisabled': isDisabled,
148
- 'euiBadge--hollow': color === 'hollow'
149
- }, iconSideToClassNameMap[iconSide], className);
143
+ }, [color, style, euiTheme]);
144
+ var styles = (0, _badge.euiBadgeStyles)(euiTheme);
145
+ var cssStyles = [styles.euiBadge, (onClick || href) && !iconOnClick && styles.clickable, isDisabled && styles.disabled, color === 'hollow' && styles.hollow];
146
+ var textCssStyles = [styles.text.euiBadge__text, (onClick || href) && !isDisabled && styles.text.clickable];
147
+ var iconCssStyles = [styles.icon.euiBadge__icon, styles.icon[iconSide]];
148
+ var iconButtonCssStyles = [styles.iconButton.euiBadge__iconButton, styles.iconButton[iconSide]];
149
+ var classes = (0, _classnames.default)('euiBadge', className);
150
150
  var closeClassNames = (0, _classnames.default)('euiBadge__icon', closeButtonProps && closeButtonProps.className);
151
151
  var Element = href && !isDisabled ? 'a' : 'button';
152
152
  var relObj = {};
@@ -176,6 +176,7 @@ var EuiBadge = function EuiBadge(_ref) {
176
176
  optionalIcon = (0, _react2.jsx)("button", {
177
177
  type: "button",
178
178
  className: "euiBadge__iconButton",
179
+ css: iconButtonCssStyles,
179
180
  "aria-label": iconOnClickAriaLabel,
180
181
  disabled: isDisabled,
181
182
  title: iconOnClickAriaLabel,
@@ -184,7 +185,8 @@ var EuiBadge = function EuiBadge(_ref) {
184
185
  type: iconType,
185
186
  size: "s",
186
187
  color: "inherit" // forces the icon to inherit its parent color
187
-
188
+ ,
189
+ css: iconCssStyles
188
190
  }, closeButtonProps, {
189
191
  className: closeClassNames
190
192
  })));
@@ -193,6 +195,7 @@ var EuiBadge = function EuiBadge(_ref) {
193
195
  type: iconType,
194
196
  size: children ? 's' : 'm',
195
197
  className: "euiBadge__icon",
198
+ css: iconCssStyles,
196
199
  color: "inherit" // forces the icon to inherit its parent color
197
200
 
198
201
  });
@@ -204,28 +207,34 @@ var EuiBadge = function EuiBadge(_ref) {
204
207
  }
205
208
 
206
209
  var content = (0, _react2.jsx)("span", {
207
- className: "euiBadge__content"
208
- }, children && (0, _react2.jsx)("span", {
209
- className: "euiBadge__text"
210
- }, children), optionalIcon);
210
+ className: "euiBadge__content",
211
+ css: styles.euiBadge__content
212
+ }, iconSide === 'left' && optionalIcon, children && (0, _react2.jsx)("span", {
213
+ className: "euiBadge__text",
214
+ css: textCssStyles
215
+ }, children), iconSide === 'right' && optionalIcon);
211
216
 
212
217
  if (iconOnClick) {
213
218
  return onClick || href ? (0, _react2.jsx)("span", {
214
219
  className: classes,
220
+ css: cssStyles,
215
221
  style: optionalCustomStyles
216
222
  }, (0, _react2.jsx)("span", {
217
- className: "euiBadge__content"
218
- }, (0, _react2.jsx)(_inner_text.EuiInnerText, null, function (ref, innerText) {
223
+ className: "euiBadge__content",
224
+ css: styles.euiBadge__content
225
+ }, iconSide === 'left' && optionalIcon, (0, _react2.jsx)(_inner_text.EuiInnerText, null, function (ref, innerText) {
219
226
  return (0, _react2.jsx)(Element, _extends({
220
227
  className: "euiBadge__childButton",
228
+ css: styles.euiBadge__childButton,
221
229
  disabled: isDisabled,
222
230
  "aria-label": onClickAriaLabel,
223
231
  ref: ref,
224
232
  title: innerText
225
233
  }, relObj, rest), children);
226
- }), optionalIcon)) : (0, _react2.jsx)(_inner_text.EuiInnerText, null, function (ref, innerText) {
234
+ }), iconSide === 'right' && optionalIcon)) : (0, _react2.jsx)(_inner_text.EuiInnerText, null, function (ref, innerText) {
227
235
  return (0, _react2.jsx)("span", _extends({
228
236
  className: classes,
237
+ css: cssStyles,
229
238
  style: optionalCustomStyles,
230
239
  ref: ref,
231
240
  title: innerText
@@ -237,6 +246,7 @@ var EuiBadge = function EuiBadge(_ref) {
237
246
  disabled: isDisabled,
238
247
  "aria-label": onClickAriaLabel,
239
248
  className: classes,
249
+ css: cssStyles,
240
250
  style: optionalCustomStyles,
241
251
  ref: ref,
242
252
  title: innerText
@@ -246,6 +256,7 @@ var EuiBadge = function EuiBadge(_ref) {
246
256
  return (0, _react2.jsx)(_inner_text.EuiInnerText, null, function (ref, innerText) {
247
257
  return (0, _react2.jsx)("span", _extends({
248
258
  className: classes,
259
+ css: cssStyles,
249
260
  style: optionalCustomStyles,
250
261
  ref: ref,
251
262
  title: innerText
@@ -264,12 +275,12 @@ EuiBadge.propTypes = {
264
275
  /**
265
276
  * The side of the badge the icon should sit
266
277
  */
267
- iconSide: _propTypes.default.oneOf(["left", "right"]),
278
+ iconSide: _propTypes.default.any,
268
279
 
269
280
  /**
270
281
  * Accepts either our palette colors (primary, success ..etc) or a hex value `#FFFFFF`, `#000`.
271
282
  */
272
- color: _propTypes.default.oneOfType([_propTypes.default.string.isRequired, _propTypes.default.any.isRequired]),
283
+ color: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.string.isRequired]),
273
284
 
274
285
  /**
275
286
  * Will override any color passed through the `color` prop.
@@ -315,13 +326,14 @@ function getColorContrast(textColor, color) {
315
326
  return contrastValue;
316
327
  }
317
328
 
318
- function setTextColor(bgColor) {
319
- var textColor = _services.isColorDark.apply(void 0, _toConsumableArray((0, _chromaJs.default)(bgColor).rgb())) ? colorGhost : colorInk;
329
+ function setTextColor(_ref2, bgColor) {
330
+ var euiTheme = _ref2.euiTheme;
331
+ var textColor = _services.isColorDark.apply(void 0, _toConsumableArray((0, _chromaJs.default)(bgColor).rgb())) ? euiTheme.colors.ghost : euiTheme.colors.ink;
320
332
  return textColor;
321
333
  }
322
334
 
323
335
  function handleInvalidColor(color) {
324
- var isNamedColor = color && COLORS.includes(color) || color === 'hollow';
336
+ var isNamedColor = COLORS.includes(color);
325
337
  var isValidColorString = color && (0, _utils.chromaValid)((0, _utils.parseColor)(color) || '');
326
338
 
327
339
  if (!isNamedColor && !isValidColorString) {
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.euiBadgeStyles = void 0;
7
+
8
+ var _react = require("@emotion/react");
9
+
10
+ var _global_styling = require("../../global_styling");
11
+
12
+ var _mixins = require("../../themes/amsterdam/global_styling/mixins");
13
+
14
+ var _services = require("../../services");
15
+
16
+ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
17
+
18
+ var _ref = process.env.NODE_ENV === "production" ? {
19
+ name: "1hw5vc4-clickable",
20
+ styles: "cursor:pointer;label:clickable;"
21
+ } : {
22
+ name: "1hw5vc4-clickable",
23
+ styles: "cursor:pointer;label:clickable;",
24
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
25
+ };
26
+
27
+ var euiBadgeStyles = function euiBadgeStyles(euiThemeContext) {
28
+ var euiTheme = euiThemeContext.euiTheme,
29
+ colorMode = euiThemeContext.colorMode;
30
+ return {
31
+ euiBadge: /*#__PURE__*/(0, _react.css)("display:inline-block;vertical-align:middle;padding:0 ", euiTheme.size.s, ";", (0, _global_styling.logicalCSS)('max-width', '100%'), " font-size:", (0, _global_styling.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:", parseFloat(String(euiTheme.border.radius.medium)) / 2, "px;", (0, _global_styling.logicalTextAlignCSS)('left'), " &:focus-within{", (0, _global_styling.euiFocusRing)(euiThemeContext), ";}&+.euiBadge{", (0, _global_styling.logicalCSS)('margin-left', euiTheme.size.xs), ";};label:euiBadge;"),
32
+ clickable: /*#__PURE__*/(0, _react.css)("&:not(:disabled){&:hover,&:focus{text-decoration:underline;}}&:focus{", (0, _global_styling.euiFocusRing)(euiThemeContext), ";}&:disabled{cursor:not-allowed;};label:clickable;"),
33
+ disabled: /*#__PURE__*/(0, _react.css)("color:", (0, _mixins.euiButtonColor)(euiThemeContext, 'disabled').color, "!important;background-color:", (0, _mixins.euiButtonColor)(euiThemeContext, 'disabled').backgroundColor, "!important;;label:disabled;"),
34
+ // Hollow has a border and is mostly used for autocompleters.
35
+ hollow: /*#__PURE__*/(0, _react.css)("background-color:", euiTheme.colors.emptyShade, ";border-color:", colorMode === 'DARK' ? (0, _services.tint)(euiTheme.border.color, 0.15) : euiTheme.border.color, ";color:", euiTheme.colors.text, ";;label:hollow;"),
36
+ // Content wrapper
37
+ euiBadge__content: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)( // Ensure proper height in case of just displaying an icon
38
+ 'min-height', "".concat(euiTheme.base + parseFloat(String(euiTheme.border.width.thin)) * 2, "px")), " display:flex;align-items:center;overflow:hidden;;label:euiBadge__content;"),
39
+ // Text
40
+ text: {
41
+ euiBadge__text: /*#__PURE__*/(0, _react.css)((0, _global_styling.euiTextTruncate)(), " cursor:inherit;;label:euiBadge__text;"),
42
+ clickable: _ref
43
+ },
44
+ // Icon
45
+ icon: {
46
+ euiBadge__icon: /*#__PURE__*/(0, _react.css)(";label:euiBadge__icon;"),
47
+ right: /*#__PURE__*/(0, _react.css)("&:not(:only-child){", (0, _global_styling.logicalCSS)('margin-left', euiTheme.size.xs), ";};label:right;"),
48
+ left: /*#__PURE__*/(0, _react.css)("&:not(:only-child){", (0, _global_styling.logicalCSS)('margin-right', euiTheme.size.xs), ";};label:left;")
49
+ },
50
+ // Clickable icons (iconOnClick)
51
+ iconButton: {
52
+ euiBadge__iconButton: /*#__PURE__*/(0, _react.css)("font-size:0;&:focus{background-color:", (0, _services.transparentize)(euiTheme.colors.ghost, 0.8), ";color:", euiTheme.colors.ink, ";border-radius:", parseFloat(String(euiTheme.border.radius.small)) / 2, "px;}&:disabled{cursor:not-allowed;}.euiBadge__icon{margin:0!important;};label:euiBadge__iconButton;"),
53
+ right: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('margin-left', euiTheme.size.xs), ";;label:right;"),
54
+ left: /*#__PURE__*/(0, _react.css)((0, _global_styling.logicalCSS)('margin-right', euiTheme.size.xs), ";;label:left;")
55
+ },
56
+ // Used in badges with both onClick & iconOnClick
57
+ euiBadge__childButton: /*#__PURE__*/(0, _react.css)((0, _global_styling.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;")
58
+ };
59
+ };
60
+
61
+ exports.euiBadgeStyles = euiBadgeStyles;
@@ -554,6 +554,10 @@ var EuiInMemoryTable = /*#__PURE__*/function (_Component) {
554
554
 
555
555
  if (sortName !== prevState.prevProps.sortName || sortDirection !== prevState.prevProps.sortDirection) {
556
556
  updatedPrevState = _objectSpread(_objectSpread({}, updatedPrevState), {}, {
557
+ prevProps: _objectSpread(_objectSpread({}, updatedPrevState.prevProps), {}, {
558
+ sortName: sortName,
559
+ sortDirection: sortDirection
560
+ }),
557
561
  sortName: sortName,
558
562
  sortDirection: sortDirection
559
563
  });
@@ -1125,6 +1129,10 @@ EuiInMemoryTable.propTypes = {
1125
1129
  operator: _propTypes.default.oneOf(["eq", "exact", "gt", "gte", "lt", "lte"])
1126
1130
  }).isRequired).isRequired,
1127
1131
  available: _propTypes.default.func
1132
+ }).isRequired, _propTypes.default.shape({
1133
+ type: _propTypes.default.oneOf(["custom_component"]).isRequired,
1134
+ component: _propTypes.default.elementType.isRequired,
1135
+ available: _propTypes.default.func
1128
1136
  }).isRequired]).isRequired),
1129
1137
 
1130
1138
  /**
@@ -153,7 +153,6 @@ EuiButton.propTypes = {
153
153
  EuiButton.displayName = 'EuiButton'; // Use defaultProps for simple pass-through props
154
154
 
155
155
  EuiButton.defaultProps = {
156
- minWidth: 112,
157
156
  size: 'm',
158
157
  color: 'primary'
159
158
  };
@@ -24,7 +24,7 @@ var _href_validator = require("../../../services/security/href_validator");
24
24
 
25
25
  var _mixins = require("../../../themes/amsterdam/global_styling/mixins");
26
26
 
27
- var _excluded = ["children", "iconType", "iconSide", "size", "isDisabled", "disabled", "isLoading", "isSelected", "fullWidth", "minWidth", "contentProps", "textProps", "href", "target", "rel", "type"];
27
+ var _excluded = ["children", "iconType", "iconSide", "iconSize", "size", "isDisabled", "disabled", "isLoading", "isSelected", "fullWidth", "minWidth", "contentProps", "textProps", "href", "target", "rel", "type", "style"];
28
28
 
29
29
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
30
30
 
@@ -63,6 +63,7 @@ var EuiButtonDisplay = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref)
63
63
  var children = _ref2.children,
64
64
  iconType = _ref2.iconType,
65
65
  iconSide = _ref2.iconSide,
66
+ iconSize = _ref2.iconSize,
66
67
  _ref2$size = _ref2.size,
67
68
  size = _ref2$size === void 0 ? 'm' : _ref2$size,
68
69
  isDisabled = _ref2.isDisabled,
@@ -78,6 +79,7 @@ var EuiButtonDisplay = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref)
78
79
  rel = _ref2.rel,
79
80
  _ref2$type = _ref2.type,
80
81
  type = _ref2$type === void 0 ? 'button' : _ref2$type,
82
+ style = _ref2.style,
81
83
  rest = _objectWithoutProperties(_ref2, _excluded);
82
84
 
83
85
  var buttonIsDisabled = isButtonDisabled({
@@ -85,9 +87,8 @@ var EuiButtonDisplay = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref)
85
87
  isDisabled: isDisabled || disabled,
86
88
  isLoading: isLoading
87
89
  });
88
- var minWidthPx = typeof minWidth === 'number' ? "".concat(minWidth, "px") : minWidth;
89
90
  var theme = (0, _services.useEuiTheme)();
90
- var styles = (0, _button_display.euiButtonDisplayStyles)(theme, minWidthPx);
91
+ var styles = (0, _button_display.euiButtonDisplayStyles)(theme);
91
92
  var buttonRadiusStyle = (0, _mixins.useEuiButtonRadiusCSS)()[size];
92
93
  var cssStyles = [styles.euiButtonDisplay, styles[size], fullWidth && styles.fullWidth, buttonIsDisabled && styles.isDisabled, buttonRadiusStyle];
93
94
  var innerNode = (0, _react2.jsx)(_button_display_content.EuiButtonDisplayContent, _extends({
@@ -95,6 +96,7 @@ var EuiButtonDisplay = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref)
95
96
  isDisabled: buttonIsDisabled,
96
97
  iconType: iconType,
97
98
  iconSide: iconSide,
99
+ iconSize: iconSize,
98
100
  textProps: _objectSpread({}, textProps)
99
101
  }, contentProps), children);
100
102
  var element = href && !buttonIsDisabled ? 'a' : 'button';
@@ -123,6 +125,9 @@ var EuiButtonDisplay = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref)
123
125
 
124
126
  return (0, _react2.createElement)(element, _objectSpread(_objectSpread(_objectSpread({
125
127
  css: cssStyles,
128
+ style: minWidth ? _objectSpread(_objectSpread({}, style), {}, {
129
+ minWidth: minWidth
130
+ }) : style,
126
131
  ref: ref
127
132
  }, elementProps), relObj), rest), innerNode);
128
133
  });
@@ -194,7 +199,7 @@ EuiButtonDisplay.propTypes = {
194
199
  /**
195
200
  * Can only be one side `left` or `right`
196
201
  */
197
- iconSide: _propTypes.default.oneOf(["left", "right", undefined]),
202
+ iconSide: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.oneOf([undefined])]),
198
203
 
199
204
  /**
200
205
  * Object of props passed to the <span/> wrapping the content's text/children only (not icon)
@@ -207,7 +212,7 @@ EuiButtonDisplay.propTypes = {
207
212
  ref: _propTypes.default.any,
208
213
  "data-text": _propTypes.default.string
209
214
  }),
210
- iconSize: _propTypes.default.oneOf(["s", "m"]),
215
+ iconSize: _propTypes.default.any,
211
216
  isDisabled: _propTypes.default.bool,
212
217
  className: _propTypes.default.string,
213
218
  "aria-label": _propTypes.default.string,
@@ -32,11 +32,11 @@ var _ref = process.env.NODE_ENV === "production" ? {
32
32
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
33
33
  };
34
34
 
35
- var euiButtonDisplayStyles = function euiButtonDisplayStyles(euiThemeContext, minWidth) {
35
+ var euiButtonDisplayStyles = function euiButtonDisplayStyles(euiThemeContext) {
36
36
  var euiTheme = euiThemeContext.euiTheme;
37
37
  return {
38
38
  // Base
39
- euiButtonDisplay: /*#__PURE__*/(0, _react.css)(euiButtonBaseCSS(), ";", minWidth && (0, _global_styling.logicalCSS)('min-width', minWidth), ";font-weight:", euiTheme.font.weight.medium, ";padding:0 ", euiTheme.size.m, ";&:hover:not(:disabled),&:focus{text-decoration:underline;};label:euiButtonDisplay;"),
39
+ euiButtonDisplay: /*#__PURE__*/(0, _react.css)(euiButtonBaseCSS(), ";", (0, _global_styling.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;"),
40
40
  // States
41
41
  isDisabled: _ref,
42
42
  fullWidth: /*#__PURE__*/(0, _react.css)("display:block;", (0, _global_styling.logicalCSS)('width', '100%'), ";;label:fullWidth;"),
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.EuiButtonDisplayContent = void 0;
6
+ exports.ICON_SIZES = exports.ICON_SIDES = exports.EuiButtonDisplayContent = void 0;
7
7
 
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
 
@@ -31,6 +31,11 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
31
31
 
32
32
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
33
33
 
34
+ var ICON_SIZES = ['s', 'm'];
35
+ exports.ICON_SIZES = ICON_SIZES;
36
+ var ICON_SIDES = ['left', 'right'];
37
+ exports.ICON_SIDES = ICON_SIDES;
38
+
34
39
  var EuiButtonDisplayContent = function EuiButtonDisplayContent(_ref) {
35
40
  var children = _ref.children,
36
41
  textProps = _ref.textProps,
@@ -48,7 +53,7 @@ var EuiButtonDisplayContent = function EuiButtonDisplayContent(_ref) {
48
53
  var styles = (0, _button_display_content.euiButtonDisplayContentStyles)(theme);
49
54
  var cssStyles = [styles.euiButtonDisplayContent, iconSide && styles[iconSide]];
50
55
  var cssSpinnerStyles = [styles.euiButtonDisplayContent__spinner];
51
- var cssIconStyles = [styles.euiButtonDisplayContent__icon]; // Add an icon to the button if one exists.
56
+ var cssIconStyles = [styles.euiButtonDisplayContent__icon, iconSize && styles[iconSize]]; // Add an icon to the button if one exists.
52
57
 
53
58
  var icon; // When the button is disabled the text gets gray
54
59
  // and in some buttons the background gets a light gray
@@ -94,7 +99,7 @@ EuiButtonDisplayContent.propTypes = {
94
99
  /**
95
100
  * Can only be one side `left` or `right`
96
101
  */
97
- iconSide: _propTypes.default.oneOf(["left", "right", undefined]),
102
+ iconSide: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.oneOf([undefined])]),
98
103
  isLoading: _propTypes.default.bool,
99
104
 
100
105
  /**
@@ -108,7 +113,7 @@ EuiButtonDisplayContent.propTypes = {
108
113
  ref: _propTypes.default.any,
109
114
  "data-text": _propTypes.default.string
110
115
  }),
111
- iconSize: _propTypes.default.oneOf(["s", "m"]),
116
+ iconSize: _propTypes.default.any,
112
117
  isDisabled: _propTypes.default.bool,
113
118
  className: _propTypes.default.string,
114
119
  "aria-label": _propTypes.default.string,
@@ -47,7 +47,10 @@ var euiButtonDisplayContentStyles = function euiButtonDisplayContentStyles(_ref4
47
47
  left: /*#__PURE__*/(0, _react.css)(";label:left;"),
48
48
  right: _ref3,
49
49
  euiButtonDisplayContent__spinner: _ref2,
50
- euiButtonDisplayContent__icon: _ref
50
+ euiButtonDisplayContent__icon: _ref,
51
+ // Icon size
52
+ s: /*#__PURE__*/(0, _react.css)(";label:s;"),
53
+ m: /*#__PURE__*/(0, _react.css)(";label:m;")
51
54
  };
52
55
  };
53
56
 
@@ -108,7 +108,7 @@ var EuiCard = function EuiCard(_ref) {
108
108
  var isDisabled = _isDisabled || !isHrefValid;
109
109
  var isClickable = !isDisabled && (onClick || href || selectable && !selectable.isDisabled);
110
110
  var euiThemeContext = (0, _services.useEuiTheme)();
111
- var styles = (0, _card.euiCardStyles)(euiThemeContext, paddingSize, display);
111
+ var styles = (0, _card.euiCardStyles)(euiThemeContext, paddingSize);
112
112
  var cardStyles = [styles.card.euiCard, // Text alignment should always be left when horizontal
113
113
  styles.card.aligned[layout === 'horizontal' ? 'left' : textAlign], styles.card.layout[layout], isDisabled && styles.card.disabled];
114
114
  var contentStyles = [styles.content.euiCard__content, styles.content.layout[layout]];
@@ -154,7 +154,7 @@ var EuiCard = function EuiCard(_ref) {
154
154
 
155
155
  if (image && layout === 'vertical') {
156
156
  if ( /*#__PURE__*/(0, _react.isValidElement)(image) || typeof image === 'string') {
157
- var imageStyles = [styles.euiCard__image];
157
+ var imageStyles = [styles.image.euiCard__image, display === 'transparent' && styles.image.transparent];
158
158
  imageNode = (0, _react2.jsx)("div", {
159
159
  className: "euiCard__image",
160
160
  css: imageStyles
@@ -57,7 +57,7 @@ var _ref5 = process.env.NODE_ENV === "production" ? {
57
57
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
58
58
  };
59
59
 
60
- var euiCardStyles = function euiCardStyles(euiThemeContext, paddingSize, color) {
60
+ var euiCardStyles = function euiCardStyles(euiThemeContext, paddingSize) {
61
61
  var euiTheme = euiThemeContext.euiTheme;
62
62
  var paddingAmount = (0, _global_styling.euiPaddingSize)(euiThemeContext, paddingSize);
63
63
  var spacing = (0, _global_styling.euiPaddingSize)(euiThemeContext, paddingKey);
@@ -94,7 +94,10 @@ var euiCardStyles = function euiCardStyles(euiThemeContext, paddingSize, color)
94
94
  },
95
95
  disabled: _ref2
96
96
  },
97
- euiCard__image: /*#__PURE__*/(0, _react.css)("position:relative;overflow:hidden;", (0, _global_styling.logicalCSS)('width', "calc(100% + (".concat(paddingAmount, " * 2))")), ";", (0, _global_styling.logicalCSS)('left', "-".concat(paddingAmount)), ";", (0, _global_styling.logicalCSS)('top', "-".concat(paddingAmount)), ";", (0, _global_styling.logicalCSS)('margin-bottom', "-".concat(paddingAmount)), ";", (0, _global_styling.logicalCSS)('border-top-left-radius', "calc(".concat(euiTheme.border.radius.medium, " - ").concat(euiTheme.border.width.thin, ")")), " ", _global_styling.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{", (0, _global_styling.logicalCSS)('width', '100%'), ";};label:euiCard__image;"),
97
+ image: {
98
+ euiCard__image: /*#__PURE__*/(0, _react.css)("position:relative;overflow:hidden;", (0, _global_styling.logicalCSS)('width', "calc(100% + (".concat(paddingAmount, " * 2))")), ";", (0, _global_styling.logicalCSS)('left', "-".concat(paddingAmount)), ";", (0, _global_styling.logicalCSS)('top', "-".concat(paddingAmount)), ";", (0, _global_styling.logicalCSS)('margin-bottom', "-".concat(paddingAmount)), ";", (0, _global_styling.logicalCSS)('border-top-left-radius', "calc(".concat(euiTheme.border.radius.medium, " - ").concat(euiTheme.border.width.thin, ")")), " ", _global_styling.logicals['border-top-right-radius'], ":calc(", euiTheme.border.radius.medium, " - ", euiTheme.border.width.thin, ");img{", (0, _global_styling.logicalCSS)('width', '100%'), ";};label:euiCard__image;"),
99
+ transparent: /*#__PURE__*/(0, _react.css)("border-radius:", euiTheme.border.radius.medium, ";;label:transparent;")
100
+ },
98
101
  icon: {
99
102
  euiCard__icon: /*#__PURE__*/(0, _react.css)(";label:euiCard__icon;"),
100
103
  withImage: /*#__PURE__*/(0, _react.css)("position:absolute;", (0, _global_styling.logicalCSS)('top', '50%'), ";", (0, _global_styling.logicalCSS)('left', '50%'), ";transform:translate(-50%, calc(-50% + -", paddingAmount, "))!important;;label:withImage;"),
@@ -144,7 +144,7 @@ EuiNotificationEvent.propTypes = {
144
144
  /**
145
145
  * Accepts either our palette colors (primary, success ..etc) or a hex value `#FFFFFF`, `#000`.
146
146
  */
147
- badgeColor: _propTypes.default.oneOfType([_propTypes.default.string.isRequired, _propTypes.default.any.isRequired]),
147
+ badgeColor: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.string.isRequired]),
148
148
 
149
149
  /**
150
150
  * The icon used to visually represent this data type. Accepts any `EuiIcon IconType`.
@@ -165,7 +165,7 @@ EuiNotificationEventMeta.propTypes = {
165
165
  /**
166
166
  * Accepts either our palette colors (primary, success ..etc) or a hex value `#FFFFFF`, `#000`.
167
167
  */
168
- badgeColor: _propTypes.default.oneOfType([_propTypes.default.string.isRequired, _propTypes.default.any.isRequired]),
168
+ badgeColor: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.string.isRequired]),
169
169
 
170
170
  /**
171
171
  * The icon used to visually represent this data type. Accepts any `EuiIcon IconType`.
@@ -47,9 +47,9 @@ var EuiPopoverTitle = function EuiPopoverTitle(_ref) {
47
47
  panelPadding = _useContext.paddingSize;
48
48
 
49
49
  var euiTheme = (0, _services.useEuiTheme)();
50
- var styles = (0, _popover_title.euiPopoverTitleStyles)(euiTheme, panelPadding);
50
+ var styles = (0, _popover_title.euiPopoverTitleStyles)(euiTheme);
51
51
  var paddingStyles = (0, _global_styling.useEuiPaddingCSS)();
52
- var cssStyles = [styles.euiPopoverTitle, // If a paddingSize is not directly provided, inherit from the EuiPopoverPanel
52
+ var cssStyles = [styles.euiPopoverTitle, styles.panelPaddingSizes[panelPadding], // If a paddingSize is not directly provided, inherit from the EuiPopoverPanel
53
53
  paddingStyles[paddingSize || panelPadding]];
54
54
  var classes = (0, _classnames.default)('euiPopoverTitle', className);
55
55
  return (0, _react2.jsx)("div", _extends({