@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
@@ -2,6 +2,8 @@
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
4
 
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
6
+
5
7
  Object.defineProperty(exports, "__esModule", {
6
8
  value: true
7
9
  });
@@ -15,7 +17,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
15
17
 
16
18
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
17
19
 
18
- var _react = _interopRequireDefault(require("react"));
20
+ var _react = _interopRequireWildcard(require("react"));
19
21
 
20
22
  var _propTypes = _interopRequireDefault(require("prop-types"));
21
23
 
@@ -23,8 +25,6 @@ var _classnames = _interopRequireDefault(require("classnames"));
23
25
 
24
26
  var _chromaJs = _interopRequireDefault(require("chroma-js"));
25
27
 
26
- var _common = require("../common");
27
-
28
28
  var _services = require("../../services");
29
29
 
30
30
  var _inner_text = require("../inner_text");
@@ -35,38 +35,28 @@ var _utils = require("../color_picker/utils");
35
35
 
36
36
  var _href_validator = require("../../services/security/href_validator");
37
37
 
38
+ var _badge = require("./badge.styles");
39
+
38
40
  var _react2 = require("@emotion/react");
39
41
 
40
42
  var _excluded = ["children", "color", "iconType", "iconSide", "className", "isDisabled", "onClick", "iconOnClick", "onClickAriaLabel", "iconOnClickAriaLabel", "closeButtonProps", "href", "rel", "target", "style"];
41
43
 
44
+ 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); }
45
+
46
+ 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; }
47
+
42
48
  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; }
43
49
 
44
50
  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) { (0, _defineProperty2.default)(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; }
45
51
 
46
- // TODO - replace with variables once https://github.com/elastic/eui/issues/2731 is closed
47
- var colorInk = '#000';
48
- var colorGhost = '#fff'; // The color blind palette has some stricter accessibility needs with regards to
52
+ var ICON_SIDES = ['left', 'right'];
53
+ exports.ICON_SIDES = ICON_SIDES;
54
+ var COLORS = ['default', 'hollow', 'primary', 'success', 'accent', 'warning', 'danger'];
55
+ exports.COLORS = COLORS;
56
+ // The color blind palette has some stricter accessibility needs with regards to
49
57
  // charts and contrast. We use the euiPaletteColorBlindBehindText variant here since our
50
58
  // accessibility concerns pertain to foreground (text) and background contrast
51
-
52
59
  var visColors = (0, _services.euiPaletteColorBlindBehindText)();
53
- var colorToHexMap = {
54
- // TODO - replace with variable once https://github.com/elastic/eui/issues/2731 is closed
55
- default: '#d3dae6',
56
- primary: visColors[1],
57
- success: visColors[0],
58
- accent: visColors[2],
59
- warning: visColors[5],
60
- danger: visColors[9]
61
- };
62
- var COLORS = (0, _common.keysOf)(colorToHexMap);
63
- exports.COLORS = COLORS;
64
- var iconSideToClassNameMap = {
65
- left: 'euiBadge--iconLeft',
66
- right: 'euiBadge--iconRight'
67
- };
68
- var ICON_SIDES = (0, _common.keysOf)(iconSideToClassNameMap);
69
- exports.ICON_SIDES = ICON_SIDES;
70
60
 
71
61
  var EuiBadge = function EuiBadge(_ref) {
72
62
  var children = _ref.children,
@@ -87,53 +77,63 @@ var EuiBadge = function EuiBadge(_ref) {
87
77
  target = _ref.target,
88
78
  style = _ref.style,
89
79
  rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
80
+ var euiTheme = (0, _services.useEuiTheme)();
90
81
  var isHrefValid = !href || (0, _href_validator.validateHref)(href);
91
82
  var isDisabled = _isDisabled || !isHrefValid;
92
- var optionalCustomStyles = style;
93
- var textColor = null; // TODO - replace with variable once https://github.com/elastic/eui/issues/2731 is closed
94
-
95
- var wcagContrastBase = 4.5; // WCAG AA contrast level
96
-
97
- var wcagContrast = null;
98
- var colorHex = null; // Check if a valid color name was provided
99
-
100
- try {
101
- if (COLORS.indexOf(color) > -1) {
102
- // Get the hex equivalent for the provided color name
103
- colorHex = colorToHexMap[color]; // Set dark or light text color based upon best contrast
104
-
105
- textColor = setTextColor(colorHex);
106
- optionalCustomStyles = _objectSpread({
107
- backgroundColor: colorHex,
108
- color: textColor
109
- }, optionalCustomStyles);
110
- } else if (color !== 'hollow') {
111
- // This is a custom color that is neither from the base palette nor hollow
112
- // Let's do our best to ensure that it provides sufficient contrast
113
- // Set dark or light text color based upon best contrast
114
- textColor = setTextColor(color); // Check the contrast
115
-
116
- wcagContrast = getColorContrast(textColor, color);
117
-
118
- if (wcagContrast < wcagContrastBase) {
119
- // It's low contrast, so lets show a warning in the console
120
- console.warn('Warning: ', color, ' badge has low contrast of ', wcagContrast.toFixed(2), '. Should be above ', wcagContrastBase, '.');
83
+ var optionalCustomStyles = (0, _react.useMemo)(function () {
84
+ var colorToHexMap = {
85
+ default: euiTheme.euiTheme.colors.lightShade,
86
+ hollow: '',
87
+ primary: visColors[1],
88
+ success: visColors[0],
89
+ accent: visColors[2],
90
+ warning: visColors[5],
91
+ danger: visColors[9]
92
+ };
93
+ var textColor = null;
94
+ var contrastRatio = null;
95
+ var colorHex = null;
96
+
97
+ try {
98
+ // Check if a valid color name was provided
99
+ if (COLORS.includes(color)) {
100
+ if (color === 'hollow') return style; // hollow uses its own CSS class
101
+ // Get the hex equivalent for the provided color name
102
+
103
+ colorHex = colorToHexMap[color]; // Set dark or light text color based upon best contrast
104
+
105
+ textColor = setTextColor(euiTheme, colorHex);
106
+ return _objectSpread({
107
+ backgroundColor: colorHex,
108
+ color: textColor
109
+ }, style);
110
+ } else {
111
+ // This is a custom color- let's do our best to ensure that it provides sufficient contrast
112
+ // Set dark or light text color based upon best contrast
113
+ textColor = setTextColor(euiTheme, color); // Check the contrast
114
+
115
+ contrastRatio = getColorContrast(textColor, color);
116
+
117
+ if (contrastRatio < _services.wcagContrastMin) {
118
+ // It's low contrast, so lets show a warning in the console
119
+ console.warn('Warning: ', color, ' badge has low contrast of ', contrastRatio.toFixed(2), '. Should be above ', _services.wcagContrastMin, '.');
120
+ }
121
+
122
+ return _objectSpread({
123
+ backgroundColor: color,
124
+ color: textColor
125
+ }, style);
121
126
  }
122
-
123
- optionalCustomStyles = _objectSpread({
124
- backgroundColor: color,
125
- color: textColor
126
- }, optionalCustomStyles);
127
+ } catch (err) {
128
+ handleInvalidColor(color);
127
129
  }
128
- } catch (err) {
129
- handleInvalidColor(color);
130
- }
131
-
132
- var classes = (0, _classnames.default)('euiBadge', {
133
- 'euiBadge-isClickable': (onClick || href) && !iconOnClick,
134
- 'euiBadge-isDisabled': isDisabled,
135
- 'euiBadge--hollow': color === 'hollow'
136
- }, iconSideToClassNameMap[iconSide], className);
130
+ }, [color, style, euiTheme]);
131
+ var styles = (0, _badge.euiBadgeStyles)(euiTheme);
132
+ var cssStyles = [styles.euiBadge, (onClick || href) && !iconOnClick && styles.clickable, isDisabled && styles.disabled, color === 'hollow' && styles.hollow];
133
+ var textCssStyles = [styles.text.euiBadge__text, (onClick || href) && !isDisabled && styles.text.clickable];
134
+ var iconCssStyles = [styles.icon.euiBadge__icon, styles.icon[iconSide]];
135
+ var iconButtonCssStyles = [styles.iconButton.euiBadge__iconButton, styles.iconButton[iconSide]];
136
+ var classes = (0, _classnames.default)('euiBadge', className);
137
137
  var closeClassNames = (0, _classnames.default)('euiBadge__icon', closeButtonProps && closeButtonProps.className);
138
138
  var Element = href && !isDisabled ? 'a' : 'button';
139
139
  var relObj = {};
@@ -163,6 +163,7 @@ var EuiBadge = function EuiBadge(_ref) {
163
163
  optionalIcon = (0, _react2.jsx)("button", {
164
164
  type: "button",
165
165
  className: "euiBadge__iconButton",
166
+ css: iconButtonCssStyles,
166
167
  "aria-label": iconOnClickAriaLabel,
167
168
  disabled: isDisabled,
168
169
  title: iconOnClickAriaLabel,
@@ -171,7 +172,8 @@ var EuiBadge = function EuiBadge(_ref) {
171
172
  type: iconType,
172
173
  size: "s",
173
174
  color: "inherit" // forces the icon to inherit its parent color
174
-
175
+ ,
176
+ css: iconCssStyles
175
177
  }, closeButtonProps, {
176
178
  className: closeClassNames
177
179
  })));
@@ -180,6 +182,7 @@ var EuiBadge = function EuiBadge(_ref) {
180
182
  type: iconType,
181
183
  size: children ? 's' : 'm',
182
184
  className: "euiBadge__icon",
185
+ css: iconCssStyles,
183
186
  color: "inherit" // forces the icon to inherit its parent color
184
187
 
185
188
  });
@@ -191,28 +194,34 @@ var EuiBadge = function EuiBadge(_ref) {
191
194
  }
192
195
 
193
196
  var content = (0, _react2.jsx)("span", {
194
- className: "euiBadge__content"
195
- }, children && (0, _react2.jsx)("span", {
196
- className: "euiBadge__text"
197
- }, children), optionalIcon);
197
+ className: "euiBadge__content",
198
+ css: styles.euiBadge__content
199
+ }, iconSide === 'left' && optionalIcon, children && (0, _react2.jsx)("span", {
200
+ className: "euiBadge__text",
201
+ css: textCssStyles
202
+ }, children), iconSide === 'right' && optionalIcon);
198
203
 
199
204
  if (iconOnClick) {
200
205
  return onClick || href ? (0, _react2.jsx)("span", {
201
206
  className: classes,
207
+ css: cssStyles,
202
208
  style: optionalCustomStyles
203
209
  }, (0, _react2.jsx)("span", {
204
- className: "euiBadge__content"
205
- }, (0, _react2.jsx)(_inner_text.EuiInnerText, null, function (ref, innerText) {
210
+ className: "euiBadge__content",
211
+ css: styles.euiBadge__content
212
+ }, iconSide === 'left' && optionalIcon, (0, _react2.jsx)(_inner_text.EuiInnerText, null, function (ref, innerText) {
206
213
  return (0, _react2.jsx)(Element, (0, _extends2.default)({
207
214
  className: "euiBadge__childButton",
215
+ css: styles.euiBadge__childButton,
208
216
  disabled: isDisabled,
209
217
  "aria-label": onClickAriaLabel,
210
218
  ref: ref,
211
219
  title: innerText
212
220
  }, relObj, rest), children);
213
- }), optionalIcon)) : (0, _react2.jsx)(_inner_text.EuiInnerText, null, function (ref, innerText) {
221
+ }), iconSide === 'right' && optionalIcon)) : (0, _react2.jsx)(_inner_text.EuiInnerText, null, function (ref, innerText) {
214
222
  return (0, _react2.jsx)("span", (0, _extends2.default)({
215
223
  className: classes,
224
+ css: cssStyles,
216
225
  style: optionalCustomStyles,
217
226
  ref: ref,
218
227
  title: innerText
@@ -224,6 +233,7 @@ var EuiBadge = function EuiBadge(_ref) {
224
233
  disabled: isDisabled,
225
234
  "aria-label": onClickAriaLabel,
226
235
  className: classes,
236
+ css: cssStyles,
227
237
  style: optionalCustomStyles,
228
238
  ref: ref,
229
239
  title: innerText
@@ -233,6 +243,7 @@ var EuiBadge = function EuiBadge(_ref) {
233
243
  return (0, _react2.jsx)(_inner_text.EuiInnerText, null, function (ref, innerText) {
234
244
  return (0, _react2.jsx)("span", (0, _extends2.default)({
235
245
  className: classes,
246
+ css: cssStyles,
236
247
  style: optionalCustomStyles,
237
248
  ref: ref,
238
249
  title: innerText
@@ -251,12 +262,12 @@ EuiBadge.propTypes = {
251
262
  /**
252
263
  * The side of the badge the icon should sit
253
264
  */
254
- iconSide: _propTypes.default.oneOf(["left", "right"]),
265
+ iconSide: _propTypes.default.any,
255
266
 
256
267
  /**
257
268
  * Accepts either our palette colors (primary, success ..etc) or a hex value `#FFFFFF`, `#000`.
258
269
  */
259
- color: _propTypes.default.oneOfType([_propTypes.default.string.isRequired, _propTypes.default.any.isRequired]),
270
+ color: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.string.isRequired]),
260
271
 
261
272
  /**
262
273
  * Will override any color passed through the `color` prop.
@@ -302,13 +313,14 @@ function getColorContrast(textColor, color) {
302
313
  return contrastValue;
303
314
  }
304
315
 
305
- function setTextColor(bgColor) {
306
- var textColor = _services.isColorDark.apply(void 0, (0, _toConsumableArray2.default)((0, _chromaJs.default)(bgColor).rgb())) ? colorGhost : colorInk;
316
+ function setTextColor(_ref2, bgColor) {
317
+ var euiTheme = _ref2.euiTheme;
318
+ var textColor = _services.isColorDark.apply(void 0, (0, _toConsumableArray2.default)((0, _chromaJs.default)(bgColor).rgb())) ? euiTheme.colors.ghost : euiTheme.colors.ink;
307
319
  return textColor;
308
320
  }
309
321
 
310
322
  function handleInvalidColor(color) {
311
- var isNamedColor = color && COLORS.includes(color) || color === 'hollow';
323
+ var isNamedColor = COLORS.includes(color);
312
324
  var isValidColorString = color && (0, _utils.chromaValid)((0, _utils.parseColor)(color) || '');
313
325
 
314
326
  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;
@@ -542,6 +542,10 @@ var EuiInMemoryTable = /*#__PURE__*/function (_Component) {
542
542
 
543
543
  if (sortName !== prevState.prevProps.sortName || sortDirection !== prevState.prevProps.sortDirection) {
544
544
  updatedPrevState = _objectSpread(_objectSpread({}, updatedPrevState), {}, {
545
+ prevProps: _objectSpread(_objectSpread({}, updatedPrevState.prevProps), {}, {
546
+ sortName: sortName,
547
+ sortDirection: sortDirection
548
+ }),
545
549
  sortName: sortName,
546
550
  sortDirection: sortDirection
547
551
  });
@@ -1110,6 +1114,10 @@ EuiInMemoryTable.propTypes = {
1110
1114
  operator: _propTypes.default.oneOf(["eq", "exact", "gt", "gte", "lt", "lte"])
1111
1115
  }).isRequired).isRequired,
1112
1116
  available: _propTypes.default.func
1117
+ }).isRequired, _propTypes.default.shape({
1118
+ type: _propTypes.default.oneOf(["custom_component"]).isRequired,
1119
+ component: _propTypes.default.elementType.isRequired,
1120
+ available: _propTypes.default.func
1113
1121
  }).isRequired]).isRequired),
1114
1122
 
1115
1123
  /**
@@ -141,7 +141,6 @@ EuiButton.propTypes = {
141
141
  EuiButton.displayName = 'EuiButton'; // Use defaultProps for simple pass-through props
142
142
 
143
143
  EuiButton.defaultProps = {
144
- minWidth: 112,
145
144
  size: 'm',
146
145
  color: 'primary'
147
146
  };
@@ -32,7 +32,7 @@ var _href_validator = require("../../../services/security/href_validator");
32
32
 
33
33
  var _mixins = require("../../../themes/amsterdam/global_styling/mixins");
34
34
 
35
- var _excluded = ["children", "iconType", "iconSide", "size", "isDisabled", "disabled", "isLoading", "isSelected", "fullWidth", "minWidth", "contentProps", "textProps", "href", "target", "rel", "type"];
35
+ var _excluded = ["children", "iconType", "iconSide", "iconSize", "size", "isDisabled", "disabled", "isLoading", "isSelected", "fullWidth", "minWidth", "contentProps", "textProps", "href", "target", "rel", "type", "style"];
36
36
 
37
37
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
38
38
 
@@ -61,6 +61,7 @@ var EuiButtonDisplay = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref)
61
61
  var children = _ref2.children,
62
62
  iconType = _ref2.iconType,
63
63
  iconSide = _ref2.iconSide,
64
+ iconSize = _ref2.iconSize,
64
65
  _ref2$size = _ref2.size,
65
66
  size = _ref2$size === void 0 ? 'm' : _ref2$size,
66
67
  isDisabled = _ref2.isDisabled,
@@ -76,15 +77,15 @@ var EuiButtonDisplay = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref)
76
77
  rel = _ref2.rel,
77
78
  _ref2$type = _ref2.type,
78
79
  type = _ref2$type === void 0 ? 'button' : _ref2$type,
80
+ style = _ref2.style,
79
81
  rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
80
82
  var buttonIsDisabled = isButtonDisabled({
81
83
  href: href,
82
84
  isDisabled: isDisabled || disabled,
83
85
  isLoading: isLoading
84
86
  });
85
- var minWidthPx = typeof minWidth === 'number' ? "".concat(minWidth, "px") : minWidth;
86
87
  var theme = (0, _services.useEuiTheme)();
87
- var styles = (0, _button_display.euiButtonDisplayStyles)(theme, minWidthPx);
88
+ var styles = (0, _button_display.euiButtonDisplayStyles)(theme);
88
89
  var buttonRadiusStyle = (0, _mixins.useEuiButtonRadiusCSS)()[size];
89
90
  var cssStyles = [styles.euiButtonDisplay, styles[size], fullWidth && styles.fullWidth, buttonIsDisabled && styles.isDisabled, buttonRadiusStyle];
90
91
  var innerNode = (0, _react2.jsx)(_button_display_content.EuiButtonDisplayContent, (0, _extends2.default)({
@@ -92,6 +93,7 @@ var EuiButtonDisplay = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref)
92
93
  isDisabled: buttonIsDisabled,
93
94
  iconType: iconType,
94
95
  iconSide: iconSide,
96
+ iconSize: iconSize,
95
97
  textProps: _objectSpread({}, textProps)
96
98
  }, contentProps), children);
97
99
  var element = href && !buttonIsDisabled ? 'a' : 'button';
@@ -120,6 +122,9 @@ var EuiButtonDisplay = /*#__PURE__*/(0, _react.forwardRef)(function (_ref2, ref)
120
122
 
121
123
  return (0, _react2.createElement)(element, _objectSpread(_objectSpread(_objectSpread({
122
124
  css: cssStyles,
125
+ style: minWidth ? _objectSpread(_objectSpread({}, style), {}, {
126
+ minWidth: minWidth
127
+ }) : style,
123
128
  ref: ref
124
129
  }, elementProps), relObj), rest), innerNode);
125
130
  });
@@ -191,7 +196,7 @@ EuiButtonDisplay.propTypes = {
191
196
  /**
192
197
  * Can only be one side `left` or `right`
193
198
  */
194
- iconSide: _propTypes.default.oneOf(["left", "right", undefined]),
199
+ iconSide: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.oneOf([undefined])]),
195
200
 
196
201
  /**
197
202
  * Object of props passed to the <span/> wrapping the content's text/children only (not icon)
@@ -204,7 +209,7 @@ EuiButtonDisplay.propTypes = {
204
209
  ref: _propTypes.default.any,
205
210
  "data-text": _propTypes.default.string
206
211
  }),
207
- iconSize: _propTypes.default.oneOf(["s", "m"]),
212
+ iconSize: _propTypes.default.any,
208
213
  isDisabled: _propTypes.default.bool,
209
214
  className: _propTypes.default.string,
210
215
  "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;"),
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.EuiButtonDisplayContent = void 0;
8
+ exports.ICON_SIZES = exports.ICON_SIDES = exports.EuiButtonDisplayContent = void 0;
9
9
 
10
10
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
11
 
@@ -28,6 +28,10 @@ var _classnames = _interopRequireDefault(require("classnames"));
28
28
  var _react2 = require("@emotion/react");
29
29
 
30
30
  var _excluded = ["children", "textProps", "isLoading", "isDisabled", "iconType", "iconSize", "iconSide"];
31
+ var ICON_SIZES = ['s', 'm'];
32
+ exports.ICON_SIZES = ICON_SIZES;
33
+ var ICON_SIDES = ['left', 'right'];
34
+ exports.ICON_SIDES = ICON_SIDES;
31
35
 
32
36
  var EuiButtonDisplayContent = function EuiButtonDisplayContent(_ref) {
33
37
  var children = _ref.children,
@@ -45,7 +49,7 @@ var EuiButtonDisplayContent = function EuiButtonDisplayContent(_ref) {
45
49
  var styles = (0, _button_display_content.euiButtonDisplayContentStyles)(theme);
46
50
  var cssStyles = [styles.euiButtonDisplayContent, iconSide && styles[iconSide]];
47
51
  var cssSpinnerStyles = [styles.euiButtonDisplayContent__spinner];
48
- var cssIconStyles = [styles.euiButtonDisplayContent__icon]; // Add an icon to the button if one exists.
52
+ var cssIconStyles = [styles.euiButtonDisplayContent__icon, iconSize && styles[iconSize]]; // Add an icon to the button if one exists.
49
53
 
50
54
  var icon; // When the button is disabled the text gets gray
51
55
  // and in some buttons the background gets a light gray
@@ -91,7 +95,7 @@ EuiButtonDisplayContent.propTypes = {
91
95
  /**
92
96
  * Can only be one side `left` or `right`
93
97
  */
94
- iconSide: _propTypes.default.oneOf(["left", "right", undefined]),
98
+ iconSide: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.oneOf([undefined])]),
95
99
  isLoading: _propTypes.default.bool,
96
100
 
97
101
  /**
@@ -105,7 +109,7 @@ EuiButtonDisplayContent.propTypes = {
105
109
  ref: _propTypes.default.any,
106
110
  "data-text": _propTypes.default.string
107
111
  }),
108
- iconSize: _propTypes.default.oneOf(["s", "m"]),
112
+ iconSize: _propTypes.default.any,
109
113
  isDisabled: _propTypes.default.bool,
110
114
  className: _propTypes.default.string,
111
115
  "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
 
@@ -105,7 +105,7 @@ var EuiCard = function EuiCard(_ref) {
105
105
  var isDisabled = _isDisabled || !isHrefValid;
106
106
  var isClickable = !isDisabled && (onClick || href || selectable && !selectable.isDisabled);
107
107
  var euiThemeContext = (0, _services.useEuiTheme)();
108
- var styles = (0, _card.euiCardStyles)(euiThemeContext, paddingSize, display);
108
+ var styles = (0, _card.euiCardStyles)(euiThemeContext, paddingSize);
109
109
  var cardStyles = [styles.card.euiCard, // Text alignment should always be left when horizontal
110
110
  styles.card.aligned[layout === 'horizontal' ? 'left' : textAlign], styles.card.layout[layout], isDisabled && styles.card.disabled];
111
111
  var contentStyles = [styles.content.euiCard__content, styles.content.layout[layout]];
@@ -151,7 +151,7 @@ var EuiCard = function EuiCard(_ref) {
151
151
 
152
152
  if (image && layout === 'vertical') {
153
153
  if ( /*#__PURE__*/(0, _react.isValidElement)(image) || typeof image === 'string') {
154
- var imageStyles = [styles.euiCard__image];
154
+ var imageStyles = [styles.image.euiCard__image, display === 'transparent' && styles.image.transparent];
155
155
  imageNode = (0, _react2.jsx)("div", {
156
156
  className: "euiCard__image",
157
157
  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;"),
@@ -141,7 +141,7 @@ EuiNotificationEvent.propTypes = {
141
141
  /**
142
142
  * Accepts either our palette colors (primary, success ..etc) or a hex value `#FFFFFF`, `#000`.
143
143
  */
144
- badgeColor: _propTypes.default.oneOfType([_propTypes.default.string.isRequired, _propTypes.default.any.isRequired]),
144
+ badgeColor: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.string.isRequired]),
145
145
 
146
146
  /**
147
147
  * The icon used to visually represent this data type. Accepts any `EuiIcon IconType`.
@@ -162,7 +162,7 @@ EuiNotificationEventMeta.propTypes = {
162
162
  /**
163
163
  * Accepts either our palette colors (primary, success ..etc) or a hex value `#FFFFFF`, `#000`.
164
164
  */
165
- badgeColor: _propTypes.default.oneOfType([_propTypes.default.string.isRequired, _propTypes.default.any.isRequired]),
165
+ badgeColor: _propTypes.default.oneOfType([_propTypes.default.any.isRequired, _propTypes.default.string.isRequired]),
166
166
 
167
167
  /**
168
168
  * The icon used to visually represent this data type. Accepts any `EuiIcon IconType`.
@@ -45,9 +45,9 @@ var EuiPopoverTitle = function EuiPopoverTitle(_ref) {
45
45
  panelPadding = _useContext.paddingSize;
46
46
 
47
47
  var euiTheme = (0, _services.useEuiTheme)();
48
- var styles = (0, _popover_title.euiPopoverTitleStyles)(euiTheme, panelPadding);
48
+ var styles = (0, _popover_title.euiPopoverTitleStyles)(euiTheme);
49
49
  var paddingStyles = (0, _global_styling.useEuiPaddingCSS)();
50
- var cssStyles = [styles.euiPopoverTitle, // If a paddingSize is not directly provided, inherit from the EuiPopoverPanel
50
+ var cssStyles = [styles.euiPopoverTitle, styles.panelPaddingSizes[panelPadding], // If a paddingSize is not directly provided, inherit from the EuiPopoverPanel
51
51
  paddingStyles[paddingSize || panelPadding]];
52
52
  var classes = (0, _classnames.default)('euiPopoverTitle', className);
53
53
  return (0, _react2.jsx)("div", (0, _extends2.default)({