@elastic/eui 116.3.0 → 116.3.1-snapshot.1782218964187

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 (218) hide show
  1. package/es/components/avatar/avatar.js +4 -0
  2. package/es/components/avatar/avatar.styles.js +16 -16
  3. package/es/components/banner/banner.js +1 -2
  4. package/es/components/banner/banner.styles.js +1 -1
  5. package/es/components/basic_table/basic_table.js +35 -5
  6. package/es/components/basic_table/basic_table.styles.js +19 -1
  7. package/es/components/basic_table/in_memory_table.js +17 -0
  8. package/es/components/basic_table/index.js +2 -1
  9. package/es/components/basic_table/pagination_bar.js +19 -4
  10. package/es/components/basic_table/pagination_bar.styles.js +21 -0
  11. package/es/components/basic_table/panel.styles.js +14 -0
  12. package/es/components/basic_table/use_panel_props.js +28 -0
  13. package/es/components/date_picker/auto_refresh/refresh_interval.js +176 -229
  14. package/es/components/flyout/flyout.component.js +10 -6
  15. package/es/components/flyout/flyout_menu.js +122 -19
  16. package/es/components/flyout/flyout_menu.styles.js +2 -1
  17. package/es/components/flyout/manager/actions.js +20 -0
  18. package/es/components/flyout/manager/flyout_child.js +23 -1
  19. package/es/components/flyout/manager/flyout_managed.js +65 -19
  20. package/es/components/flyout/manager/hooks.js +1 -1
  21. package/es/components/flyout/manager/index.js +2 -2
  22. package/es/components/flyout/manager/reducer.js +32 -8
  23. package/es/components/flyout/manager/selectors.js +8 -2
  24. package/es/components/flyout/manager/store.js +35 -2
  25. package/es/components/flyout/use_flyout_menu.js +2 -2
  26. package/es/components/form/form_control_layout/form_control_layout_icons.js +95 -143
  27. package/es/components/notification_icon/assets/info_fill.js +34 -0
  28. package/es/components/notification_icon/assets/warning_static.js +40 -0
  29. package/es/components/notification_icon/notification_icon.js +87 -0
  30. package/es/components/notification_icon/notification_icon.styles.js +22 -0
  31. package/es/components/table/mobile/table_sort_mobile.js +64 -103
  32. package/es/components/table/store/use_unique_column_id.js +25 -0
  33. package/es/components/table/table_header_cell.js +7 -8
  34. package/es/components/table/table_header_cell_checkbox.js +5 -6
  35. package/es/components/toast/global_toast_list.js +132 -6
  36. package/es/components/toast/global_toast_list.styles.js +31 -7
  37. package/es/components/toast/toast.js +242 -47
  38. package/es/components/toast/toast.styles.js +35 -47
  39. package/es/components/toast/toast_action.js +34 -0
  40. package/es/components/toast/types.js +9 -0
  41. package/es/components/tool_tip/tool_tip.js +61 -30
  42. package/es/components/tool_tip/tool_tip_anchor.js +5 -5
  43. package/es/components/tool_tip/tool_tip_manager.js +27 -2
  44. package/eui.d.ts +811 -552
  45. package/i18ntokens.json +981 -927
  46. package/lib/components/avatar/avatar.js +4 -0
  47. package/lib/components/avatar/avatar.styles.js +16 -16
  48. package/lib/components/banner/banner.js +1 -2
  49. package/lib/components/banner/banner.styles.js +1 -1
  50. package/lib/components/basic_table/basic_table.js +34 -4
  51. package/lib/components/basic_table/basic_table.styles.js +19 -1
  52. package/lib/components/basic_table/in_memory_table.js +17 -0
  53. package/lib/components/basic_table/index.js +8 -1
  54. package/lib/components/basic_table/pagination_bar.js +19 -4
  55. package/lib/components/basic_table/pagination_bar.styles.js +26 -0
  56. package/lib/components/basic_table/panel.styles.js +20 -0
  57. package/lib/components/basic_table/use_panel_props.js +33 -0
  58. package/lib/components/date_picker/auto_refresh/refresh_interval.js +175 -229
  59. package/lib/components/flyout/flyout.component.js +10 -6
  60. package/lib/components/flyout/flyout_menu.js +120 -19
  61. package/lib/components/flyout/flyout_menu.styles.js +2 -1
  62. package/lib/components/flyout/manager/actions.js +21 -1
  63. package/lib/components/flyout/manager/flyout_child.js +23 -1
  64. package/lib/components/flyout/manager/flyout_managed.js +41 -17
  65. package/lib/components/flyout/manager/hooks.js +6 -0
  66. package/lib/components/flyout/manager/index.js +12 -0
  67. package/lib/components/flyout/manager/reducer.js +31 -7
  68. package/lib/components/flyout/manager/selectors.js +9 -3
  69. package/lib/components/flyout/manager/store.js +34 -1
  70. package/lib/components/flyout/use_flyout_menu.js +2 -2
  71. package/lib/components/form/form_control_layout/form_control_layout_icons.js +95 -145
  72. package/lib/components/notification_icon/assets/info_fill.js +41 -0
  73. package/lib/components/notification_icon/assets/warning_static.js +47 -0
  74. package/lib/components/notification_icon/notification_icon.js +93 -0
  75. package/lib/components/notification_icon/notification_icon.styles.js +28 -0
  76. package/lib/components/notification_icon/svgs/info_fill.svg +3 -0
  77. package/lib/components/notification_icon/svgs/warning_static.svg +5 -0
  78. package/lib/components/table/mobile/table_sort_mobile.js +71 -108
  79. package/lib/components/table/store/use_unique_column_id.js +34 -0
  80. package/lib/components/table/table_header_cell.js +7 -8
  81. package/lib/components/table/table_header_cell_checkbox.js +5 -6
  82. package/lib/components/toast/global_toast_list.js +132 -6
  83. package/lib/components/toast/global_toast_list.styles.js +31 -8
  84. package/lib/components/toast/toast.js +244 -47
  85. package/lib/components/toast/toast.styles.js +32 -45
  86. package/lib/components/toast/toast_action.js +40 -0
  87. package/lib/components/toast/types.js +15 -0
  88. package/lib/components/tool_tip/tool_tip.js +59 -29
  89. package/lib/components/tool_tip/tool_tip_anchor.js +5 -5
  90. package/lib/components/tool_tip/tool_tip_manager.js +27 -2
  91. package/optimize/es/components/avatar/avatar.js +4 -0
  92. package/optimize/es/components/avatar/avatar.styles.js +16 -16
  93. package/optimize/es/components/banner/banner.js +1 -2
  94. package/optimize/es/components/banner/banner.styles.js +1 -1
  95. package/optimize/es/components/basic_table/basic_table.js +18 -5
  96. package/optimize/es/components/basic_table/basic_table.styles.js +19 -1
  97. package/optimize/es/components/basic_table/index.js +2 -1
  98. package/optimize/es/components/basic_table/pagination_bar.js +19 -4
  99. package/optimize/es/components/basic_table/pagination_bar.styles.js +21 -0
  100. package/optimize/es/components/basic_table/panel.styles.js +14 -0
  101. package/optimize/es/components/basic_table/use_panel_props.js +28 -0
  102. package/optimize/es/components/date_picker/auto_refresh/refresh_interval.js +172 -196
  103. package/optimize/es/components/flyout/flyout.component.js +10 -6
  104. package/optimize/es/components/flyout/flyout_menu.js +99 -18
  105. package/optimize/es/components/flyout/flyout_menu.styles.js +2 -1
  106. package/optimize/es/components/flyout/manager/actions.js +20 -0
  107. package/optimize/es/components/flyout/manager/flyout_managed.js +42 -18
  108. package/optimize/es/components/flyout/manager/hooks.js +1 -1
  109. package/optimize/es/components/flyout/manager/index.js +2 -2
  110. package/optimize/es/components/flyout/manager/reducer.js +32 -8
  111. package/optimize/es/components/flyout/manager/selectors.js +8 -2
  112. package/optimize/es/components/flyout/manager/store.js +35 -2
  113. package/optimize/es/components/flyout/use_flyout_menu.js +2 -2
  114. package/optimize/es/components/form/form_control_layout/form_control_layout_icons.js +96 -115
  115. package/optimize/es/components/notification_icon/assets/info_fill.js +33 -0
  116. package/optimize/es/components/notification_icon/assets/warning_static.js +39 -0
  117. package/optimize/es/components/notification_icon/notification_icon.js +77 -0
  118. package/optimize/es/components/notification_icon/notification_icon.styles.js +22 -0
  119. package/optimize/es/components/table/mobile/table_sort_mobile.js +59 -82
  120. package/optimize/es/components/table/store/use_unique_column_id.js +25 -0
  121. package/optimize/es/components/table/table_header_cell.js +7 -8
  122. package/optimize/es/components/table/table_header_cell_checkbox.js +5 -6
  123. package/optimize/es/components/toast/global_toast_list.js +31 -6
  124. package/optimize/es/components/toast/global_toast_list.styles.js +31 -7
  125. package/optimize/es/components/toast/toast.js +143 -47
  126. package/optimize/es/components/toast/toast.styles.js +35 -47
  127. package/optimize/es/components/toast/toast_action.js +33 -0
  128. package/optimize/es/components/toast/types.js +9 -0
  129. package/optimize/es/components/tool_tip/tool_tip.js +58 -30
  130. package/optimize/es/components/tool_tip/tool_tip_anchor.js +5 -5
  131. package/optimize/es/components/tool_tip/tool_tip_manager.js +27 -2
  132. package/optimize/lib/components/avatar/avatar.js +4 -0
  133. package/optimize/lib/components/avatar/avatar.styles.js +16 -16
  134. package/optimize/lib/components/banner/banner.js +1 -2
  135. package/optimize/lib/components/banner/banner.styles.js +1 -1
  136. package/optimize/lib/components/basic_table/basic_table.js +17 -4
  137. package/optimize/lib/components/basic_table/basic_table.styles.js +19 -1
  138. package/optimize/lib/components/basic_table/index.js +8 -1
  139. package/optimize/lib/components/basic_table/pagination_bar.js +19 -4
  140. package/optimize/lib/components/basic_table/pagination_bar.styles.js +26 -0
  141. package/optimize/lib/components/basic_table/panel.styles.js +20 -0
  142. package/optimize/lib/components/basic_table/use_panel_props.js +33 -0
  143. package/optimize/lib/components/date_picker/auto_refresh/refresh_interval.js +170 -194
  144. package/optimize/lib/components/flyout/flyout.component.js +10 -6
  145. package/optimize/lib/components/flyout/flyout_menu.js +98 -18
  146. package/optimize/lib/components/flyout/flyout_menu.styles.js +2 -1
  147. package/optimize/lib/components/flyout/manager/actions.js +21 -1
  148. package/optimize/lib/components/flyout/manager/flyout_managed.js +41 -17
  149. package/optimize/lib/components/flyout/manager/hooks.js +6 -0
  150. package/optimize/lib/components/flyout/manager/index.js +12 -0
  151. package/optimize/lib/components/flyout/manager/reducer.js +31 -7
  152. package/optimize/lib/components/flyout/manager/selectors.js +9 -3
  153. package/optimize/lib/components/flyout/manager/store.js +34 -1
  154. package/optimize/lib/components/flyout/use_flyout_menu.js +2 -2
  155. package/optimize/lib/components/form/form_control_layout/form_control_layout_icons.js +96 -117
  156. package/optimize/lib/components/notification_icon/assets/info_fill.js +41 -0
  157. package/optimize/lib/components/notification_icon/assets/warning_static.js +47 -0
  158. package/optimize/lib/components/notification_icon/notification_icon.js +83 -0
  159. package/optimize/lib/components/notification_icon/notification_icon.styles.js +28 -0
  160. package/optimize/lib/components/notification_icon/svgs/info_fill.svg +3 -0
  161. package/optimize/lib/components/notification_icon/svgs/warning_static.svg +5 -0
  162. package/optimize/lib/components/table/mobile/table_sort_mobile.js +61 -83
  163. package/optimize/lib/components/table/store/use_unique_column_id.js +34 -0
  164. package/optimize/lib/components/table/table_header_cell.js +7 -8
  165. package/optimize/lib/components/table/table_header_cell_checkbox.js +5 -6
  166. package/optimize/lib/components/toast/global_toast_list.js +31 -6
  167. package/optimize/lib/components/toast/global_toast_list.styles.js +30 -7
  168. package/optimize/lib/components/toast/toast.js +146 -47
  169. package/optimize/lib/components/toast/toast.styles.js +33 -45
  170. package/optimize/lib/components/toast/toast_action.js +39 -0
  171. package/optimize/lib/components/toast/types.js +15 -0
  172. package/optimize/lib/components/tool_tip/tool_tip.js +57 -29
  173. package/optimize/lib/components/tool_tip/tool_tip_anchor.js +5 -5
  174. package/optimize/lib/components/tool_tip/tool_tip_manager.js +27 -2
  175. package/package.json +9 -6
  176. package/test-env/components/avatar/avatar.js +4 -0
  177. package/test-env/components/avatar/avatar.styles.js +16 -16
  178. package/test-env/components/banner/banner.js +1 -2
  179. package/test-env/components/banner/banner.styles.js +1 -1
  180. package/test-env/components/basic_table/basic_table.js +34 -4
  181. package/test-env/components/basic_table/basic_table.styles.js +19 -1
  182. package/test-env/components/basic_table/in_memory_table.js +17 -0
  183. package/test-env/components/basic_table/index.js +8 -1
  184. package/test-env/components/basic_table/pagination_bar.js +19 -4
  185. package/test-env/components/basic_table/pagination_bar.styles.js +26 -0
  186. package/test-env/components/basic_table/panel.styles.js +20 -0
  187. package/test-env/components/basic_table/use_panel_props.js +33 -0
  188. package/test-env/components/date_picker/auto_refresh/refresh_interval.js +170 -220
  189. package/test-env/components/flyout/flyout.component.js +10 -6
  190. package/test-env/components/flyout/flyout_menu.js +121 -19
  191. package/test-env/components/flyout/flyout_menu.styles.js +2 -1
  192. package/test-env/components/flyout/manager/actions.js +21 -1
  193. package/test-env/components/flyout/manager/flyout_child.js +23 -1
  194. package/test-env/components/flyout/manager/flyout_managed.js +41 -17
  195. package/test-env/components/flyout/manager/hooks.js +6 -0
  196. package/test-env/components/flyout/manager/index.js +12 -0
  197. package/test-env/components/flyout/manager/reducer.js +31 -7
  198. package/test-env/components/flyout/manager/selectors.js +9 -3
  199. package/test-env/components/flyout/manager/store.js +34 -1
  200. package/test-env/components/flyout/use_flyout_menu.js +2 -2
  201. package/test-env/components/form/form_control_layout/form_control_layout_icons.js +95 -139
  202. package/test-env/components/notification_icon/assets/info_fill.js +41 -0
  203. package/test-env/components/notification_icon/assets/warning_static.js +47 -0
  204. package/test-env/components/notification_icon/notification_icon.js +46 -0
  205. package/test-env/components/notification_icon/notification_icon.styles.js +28 -0
  206. package/test-env/components/table/mobile/table_sort_mobile.js +61 -98
  207. package/test-env/components/table/store/use_unique_column_id.js +34 -0
  208. package/test-env/components/table/table_header_cell.js +7 -8
  209. package/test-env/components/table/table_header_cell_checkbox.js +5 -6
  210. package/test-env/components/toast/global_toast_list.js +132 -6
  211. package/test-env/components/toast/global_toast_list.styles.js +30 -7
  212. package/test-env/components/toast/toast.js +242 -47
  213. package/test-env/components/toast/toast.styles.js +33 -45
  214. package/test-env/components/toast/toast_action.js +39 -0
  215. package/test-env/components/toast/types.js +15 -0
  216. package/test-env/components/tool_tip/tool_tip.js +57 -29
  217. package/test-env/components/tool_tip/tool_tip_anchor.js +5 -5
  218. package/test-env/components/tool_tip/tool_tip_manager.js +27 -2
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.EuiToastAction = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _button = require("../button");
9
+ var _react2 = require("@emotion/react");
10
+ var _excluded = ["children", "actionType", "color"];
11
+ /*
12
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
13
+ * or more contributor license agreements. Licensed under the Elastic License
14
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
15
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
16
+ * Side Public License, v 1.
17
+ */
18
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
19
+ function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
20
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) >= 0 || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
21
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.indexOf(n) >= 0) continue; t[n] = r[n]; } return t; }
22
+ var EuiToastAction = exports.EuiToastAction = function EuiToastAction(_ref) {
23
+ var children = _ref.children,
24
+ _ref$actionType = _ref.actionType,
25
+ actionType = _ref$actionType === void 0 ? 'primary' : _ref$actionType,
26
+ _ref$color = _ref.color,
27
+ color = _ref$color === void 0 ? 'primary' : _ref$color,
28
+ rest = _objectWithoutProperties(_ref, _excluded);
29
+ if (actionType === 'primary') {
30
+ return (0, _react2.jsx)(_button.EuiButton, _extends({
31
+ size: "s",
32
+ color: color
33
+ }, rest), children);
34
+ } else {
35
+ return (0, _react2.jsx)(_button.EuiButtonEmpty, _extends({
36
+ size: "s",
37
+ color: color
38
+ }, rest), children);
39
+ }
40
+ };
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.COLORS = void 0;
7
+ /*
8
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
9
+ * or more contributor license agreements. Licensed under the Elastic License
10
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
11
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
12
+ * Side Public License, v 1.
13
+ */
14
+
15
+ var COLORS = exports.COLORS = ['primary', 'success', 'warning', 'danger'];
@@ -29,6 +29,11 @@ var _excluded = ["children", "className", "anchorClassName", "anchorProps", "con
29
29
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
30
30
  function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
31
31
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
32
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
33
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
34
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
35
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
36
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
32
37
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
33
38
  function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
34
39
  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."); }
@@ -91,22 +96,26 @@ var EuiToolTip = exports.EuiToolTip = /*#__PURE__*/(0, _react.forwardRef)(functi
91
96
  setVisible = _useState2[1];
92
97
  var _useState3 = (0, _react.useState)(false),
93
98
  _useState4 = _slicedToArray(_useState3, 2),
94
- hasFocus = _useState4[0],
95
- setHasFocus = _useState4[1];
96
- var _useState5 = (0, _react.useState)(positionProp),
99
+ skipAnimation = _useState4[0],
100
+ setSkipAnimation = _useState4[1];
101
+ var _useState5 = (0, _react.useState)(false),
97
102
  _useState6 = _slicedToArray(_useState5, 2),
98
- calculatedPosition = _useState6[0],
99
- setCalculatedPosition = _useState6[1];
100
- var _useState7 = (0, _react.useState)(DEFAULT_TOOLTIP_STYLES),
103
+ hasFocus = _useState6[0],
104
+ setHasFocus = _useState6[1];
105
+ var _useState7 = (0, _react.useState)(positionProp),
101
106
  _useState8 = _slicedToArray(_useState7, 2),
102
- toolTipStyles = _useState8[0],
103
- setToolTipStyles = _useState8[1];
104
- var _useState9 = (0, _react.useState)(undefined),
107
+ calculatedPosition = _useState8[0],
108
+ setCalculatedPosition = _useState8[1];
109
+ var _useState9 = (0, _react.useState)(DEFAULT_TOOLTIP_STYLES),
105
110
  _useState10 = _slicedToArray(_useState9, 2),
106
- arrowStyles = _useState10[0],
107
- setArrowStyles = _useState10[1];
108
- var generatedId = (0, _react.useRef)((0, _services.htmlIdGenerator)()());
109
- var id = idProp !== null && idProp !== void 0 ? idProp : generatedId.current;
111
+ toolTipStyles = _useState10[0],
112
+ setToolTipStyles = _useState10[1];
113
+ var _useState11 = (0, _react.useState)(undefined),
114
+ _useState12 = _slicedToArray(_useState11, 2),
115
+ arrowStyles = _useState12[0],
116
+ setArrowStyles = _useState12[1];
117
+ var generatedId = (0, _services.useGeneratedHtmlId)();
118
+ var id = idProp !== null && idProp !== void 0 ? idProp : generatedId;
110
119
  var anchorRef = (0, _react.useRef)(null);
111
120
  var popoverRef = (0, _react.useRef)(null);
112
121
  var positionToolTip = (0, _react.useCallback)(function () {
@@ -158,10 +167,19 @@ var EuiToolTip = exports.EuiToolTip = /*#__PURE__*/(0, _react.forwardRef)(functi
158
167
  setArrowStyles(undefined);
159
168
  _tool_tip_manager.toolTipManager.deregisterToolTip(hideToolTip);
160
169
  }, []);
170
+
171
+ /**
172
+ * Show the tooltip.
173
+ *
174
+ * Uses the tooltip manager's `skipAnimation` signal to optionally skip the entry
175
+ * animation when another tooltip is already open or was just closed.
176
+ */
161
177
  var showToolTip = (0, _react.useCallback)(function () {
162
178
  if (!content && !title) return;
179
+ var result = _tool_tip_manager.toolTipManager.registerTooltip(hideToolTip);
180
+ if (!result) return;
181
+ setSkipAnimation(result.skipAnimation);
163
182
  setVisible(true);
164
- _tool_tip_manager.toolTipManager.registerTooltip(hideToolTip);
165
183
  }, [content, title, hideToolTip]);
166
184
  (0, _react.useImperativeHandle)(ref, function () {
167
185
  return {
@@ -241,18 +259,24 @@ var EuiToolTip = exports.EuiToolTip = /*#__PURE__*/(0, _react.forwardRef)(functi
241
259
  hideToolTip();
242
260
  }
243
261
  }, [disableScreenReaderOutput, visible, hideToolTip]);
244
- var onMouseOut = (0, _react.useCallback)(function (event) {
245
- // Prevent mousing over children from hiding the tooltip by testing for whether the mouse has
246
- // left the anchor for a non-child.
247
- if (anchorRef.current === event.relatedTarget || anchorRef.current != null && !anchorRef.current.contains(event.relatedTarget)) {
248
- if (!hasFocus) {
249
- hideToolTip();
250
- }
251
- }
252
- if (onMouseOutProp) {
253
- onMouseOutProp(event);
254
- }
255
- }, [hasFocus, hideToolTip, onMouseOutProp]);
262
+
263
+ /**
264
+ * Show the tooltip on enter.
265
+ */
266
+ var onMouseEnter = (0, _react.useCallback)(function (event) {
267
+ var _anchorProps$onMouseE;
268
+ showToolTip();
269
+ anchorProps === null || anchorProps === void 0 || (_anchorProps$onMouseE = anchorProps.onMouseEnter) === null || _anchorProps$onMouseE === void 0 || _anchorProps$onMouseE.call(anchorProps, event);
270
+ }, [showToolTip, anchorProps === null || anchorProps === void 0 ? void 0 : anchorProps.onMouseEnter]);
271
+
272
+ /**
273
+ * Hide the tooltip if the mouse is not over the trigger.
274
+ */
275
+ var onMouseLeave = (0, _react.useCallback)(function (event) {
276
+ var _anchorProps$onMouseL;
277
+ if (!hasFocus) hideToolTip();
278
+ anchorProps === null || anchorProps === void 0 || (_anchorProps$onMouseL = anchorProps.onMouseLeave) === null || _anchorProps$onMouseL === void 0 || _anchorProps$onMouseL.call(anchorProps, event);
279
+ }, [hasFocus, hideToolTip, anchorProps === null || anchorProps === void 0 ? void 0 : anchorProps.onMouseLeave]);
256
280
  var classes = (0, _classnames.default)('euiToolTip', className);
257
281
  var anchorClasses = (0, _classnames.default)(anchorClassName, anchorProps === null || anchorProps === void 0 ? void 0 : anchorProps.className);
258
282
  return (0, _react2.jsx)(_react.default.Fragment, null, (0, _react2.jsx)(_tool_tip_anchor.EuiToolTipAnchor, _extends({}, anchorProps, {
@@ -260,8 +284,9 @@ var EuiToolTip = exports.EuiToolTip = /*#__PURE__*/(0, _react.forwardRef)(functi
260
284
  onBlur: onBlur,
261
285
  onFocus: onFocus,
262
286
  onKeyDown: onEscapeKey,
263
- onMouseOver: showToolTip,
264
- onMouseOut: onMouseOut
287
+ onMouseEnter: onMouseEnter,
288
+ onMouseLeave: onMouseLeave,
289
+ onMouseOut: onMouseOutProp
265
290
  // `id` defines if the trigger and tooltip are automatically linked via `aria-describedby`.
266
291
  ,
267
292
  id: !disableScreenReaderOutput ? id : undefined,
@@ -270,7 +295,12 @@ var EuiToolTip = exports.EuiToolTip = /*#__PURE__*/(0, _react.forwardRef)(functi
270
295
  isVisible: visible
271
296
  }), children), visible && (content || title) && (0, _react2.jsx)(_portal.EuiPortal, null, (0, _react2.jsx)(_tool_tip_popover.EuiToolTipPopover, _extends({
272
297
  className: classes,
273
- style: toolTipStyles,
298
+ style: _objectSpread(_objectSpread({}, toolTipStyles), {}, {
299
+ // Inline `animation: none` overrides the keyframes fade-in
300
+ // shorthand on the base `.euiToolTip` class, so a tooltip
301
+ // shown right after another closes appears instantly.
302
+ animation: skipAnimation ? 'none' : undefined
303
+ }),
274
304
  positionToolTip: positionToolTip,
275
305
  popoverRef: setPopoverRef,
276
306
  title: title,
@@ -11,7 +11,7 @@ var _classnames = _interopRequireDefault(require("classnames"));
11
11
  var _services = require("../../services");
12
12
  var _tool_tip = require("./tool_tip.styles");
13
13
  var _react2 = require("@emotion/react");
14
- var _excluded = ["onBlur", "onFocus", "onMouseOver", "onMouseOut", "id", "className", "children", "display", "isVisible"];
14
+ var _excluded = ["onBlur", "onFocus", "onMouseEnter", "onMouseLeave", "id", "className", "children", "display", "isVisible"];
15
15
  /*
16
16
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
17
17
  * or more contributor license agreements. Licensed under the Elastic License
@@ -28,8 +28,8 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
28
28
  var EuiToolTipAnchor = exports.EuiToolTipAnchor = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
29
29
  var _onBlur = _ref.onBlur,
30
30
  _onFocus = _ref.onFocus,
31
- onMouseOver = _ref.onMouseOver,
32
- onMouseOut = _ref.onMouseOut,
31
+ onMouseEnter = _ref.onMouseEnter,
32
+ onMouseLeave = _ref.onMouseLeave,
33
33
  id = _ref.id,
34
34
  className = _ref.className,
35
35
  children = _ref.children,
@@ -53,8 +53,8 @@ var EuiToolTipAnchor = exports.EuiToolTipAnchor = /*#__PURE__*/(0, _react.forwar
53
53
  id: anchorId
54
54
  }, rest, {
55
55
  className: classes,
56
- onMouseOver: onMouseOver,
57
- onMouseOut: onMouseOut
56
+ onMouseEnter: onMouseEnter,
57
+ onMouseLeave: onMouseLeave
58
58
  }), /*#__PURE__*/(0, _react.cloneElement)(children, {
59
59
  onFocus: function onFocus(e) {
60
60
  _onFocus(e);
@@ -18,29 +18,54 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
18
18
  * in compliance with, at your election, the Elastic License 2.0 or the Server
19
19
  * Side Public License, v 1.
20
20
  */
21
+
21
22
  /**
22
23
  * Manager utility that ensures only one tooltip is visible at a time
24
+ * and lets the next tooltip to open skip its entry animation if another was
25
+ * just opened or just closed.
23
26
  *
24
27
  * UX rationale (primarily for mouse-only users):
25
28
  * @see https://github.com/elastic/kibana/issues/144482
26
29
  * @see https://github.com/elastic/eui/issues/5883
27
30
  */
31
+
32
+ /**
33
+ * Time window in ms after a tooltip closes during which the next one to open
34
+ * skips its entry animation.
35
+ */
36
+ var SKIP_ANIMATION_WINDOW = 300;
28
37
  var ToolTipManager = /*#__PURE__*/_createClass(function ToolTipManager() {
29
38
  var _this = this;
30
39
  _classCallCheck(this, ToolTipManager);
31
40
  // We use a set instead of a single var just in case
32
41
  // multiple tooltips are registered via async shenanigans
33
42
  _defineProperty(this, "toolTipsToHide", new Set());
43
+ // Timestamp of the last hide; `null` means no tooltip has closed yet.
44
+ _defineProperty(this, "lastHiddenAt", null);
34
45
  _defineProperty(this, "registerTooltip", function (hideCallback) {
35
- if (_this.toolTipsToHide.has(hideCallback)) return;
46
+ if (_this.toolTipsToHide.has(hideCallback)) return null;
47
+ var hadOpen = _this.toolTipsToHide.size > 0;
48
+ var recentlyClosed = _this.lastHiddenAt !== null && Date.now() - _this.lastHiddenAt < SKIP_ANIMATION_WINDOW;
36
49
  _this.toolTipsToHide.forEach(function (hide) {
37
50
  return hide();
38
51
  });
39
52
  _this.toolTipsToHide.clear();
40
53
  _this.toolTipsToHide.add(hideCallback);
54
+ return {
55
+ skipAnimation: hadOpen || recentlyClosed
56
+ };
41
57
  });
42
58
  _defineProperty(this, "deregisterToolTip", function (hideCallback) {
43
- _this.toolTipsToHide.delete(hideCallback);
59
+ if (_this.toolTipsToHide.delete(hideCallback)) _this.lastHiddenAt = Date.now();
60
+ });
61
+ /**
62
+ * Resets all internal state. Primarily intended for tests, so that a
63
+ * tooltip shown in one test doesn't leak into the next (the manager is a
64
+ * module-level singleton).
65
+ */
66
+ _defineProperty(this, "reset", function () {
67
+ _this.toolTipsToHide.clear();
68
+ _this.lastHiddenAt = null;
44
69
  });
45
70
  });
46
71
  var toolTipManager = exports.toolTipManager = new ToolTipManager();
@@ -65,6 +65,7 @@ export var EuiAvatar = function EuiAvatar(_ref) {
65
65
  var classes = classNames('euiAvatar', _defineProperty(_defineProperty(_defineProperty({}, "euiAvatar--".concat(size), size), "euiAvatar--".concat(type), type), 'euiAvatar-isDisabled', isDisabled), className);
66
66
  var styles = useEuiMemoizedStyles(euiAvatarStyles);
67
67
  var cssStyles = [styles.euiAvatar, styles[type], styles[size], styles[casing], isPlain && styles.plain, isSubdued && styles.subdued, isDisabled && styles.isDisabled];
68
+ var tooltipCssStyles = [styles.tooltip[type]];
68
69
  var avatarStyle = useMemo(function () {
69
70
  if (imageUrl) {
70
71
  return {
@@ -119,6 +120,9 @@ export var EuiAvatar = function EuiAvatar(_ref) {
119
120
  // It already has `aria-label`, the tooltip is only visual.
120
121
  return name ? ___EmotionJSX(EuiToolTip, {
121
122
  content: name,
123
+ anchorProps: {
124
+ css: tooltipCssStyles
125
+ },
122
126
  disableScreenReaderOutput: true
123
127
  }, avatarNode) : avatarNode;
124
128
  };
@@ -9,9 +9,9 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
9
9
 
10
10
  import { css } from '@emotion/react';
11
11
  import { logicalSizeCSS, mathWithUnits } from '../../global_styling';
12
- var _avatarSize = function _avatarSize(_ref7) {
13
- var size = _ref7.size,
14
- fontSize = _ref7.fontSize;
12
+ var _avatarSize = function _avatarSize(_ref6) {
13
+ var size = _ref6.size,
14
+ fontSize = _ref6.fontSize;
15
15
  return "\n ".concat(logicalSizeCSS(size), ";\n font-size: ").concat(fontSize, ";\n ");
16
16
  };
17
17
  var _ref = process.env.NODE_ENV === "production" ? {
@@ -54,24 +54,20 @@ var _ref5 = process.env.NODE_ENV === "production" ? {
54
54
  styles: "cursor:not-allowed;filter:grayscale(100%);label:isDisabled;",
55
55
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
56
56
  };
57
- var _ref6 = process.env.NODE_ENV === "production" ? {
58
- name: "ont6vs-user",
59
- styles: "border-radius:50%;label:user;"
60
- } : {
61
- name: "ont6vs-user",
62
- styles: "border-radius:50%;label:user;",
63
- toString: _EMOTION_STRINGIFIED_CSS_ERROR__
64
- };
65
- export var euiAvatarStyles = function euiAvatarStyles(_ref8) {
66
- var euiTheme = _ref8.euiTheme;
57
+ export var euiAvatarStyles = function euiAvatarStyles(_ref7) {
58
+ var euiTheme = _ref7.euiTheme;
59
+ var borderRadius = {
60
+ user: '50%',
61
+ space: euiTheme.border.radius.medium
62
+ };
67
63
  return {
68
64
  // Base
69
65
  euiAvatar: /*#__PURE__*/css("flex-shrink:0;display:inline-flex;justify-content:center;align-items:center;vertical-align:middle;background-size:cover;background-color:", euiTheme.colors.lightShade, ";overflow:hidden;font-weight:", euiTheme.font.weight.medium, ";;label:euiAvatar;"),
70
66
  // Variants
71
67
  plain: /*#__PURE__*/css("background-color:", euiTheme.colors.emptyShade, ";;label:plain;"),
72
68
  subdued: /*#__PURE__*/css("background-color:", euiTheme.colors.lightestShade, ";;label:subdued;"),
73
- user: _ref6,
74
- space: /*#__PURE__*/css("border-radius:", euiTheme.border.radius.medium, ";;label:space;"),
69
+ user: /*#__PURE__*/css("border-radius:", borderRadius.user, ";;label:user;"),
70
+ space: /*#__PURE__*/css("border-radius:", borderRadius.space, ";;label:space;"),
75
71
  // States
76
72
  isDisabled: _ref5,
77
73
  // Sizes
@@ -101,6 +97,10 @@ export var euiAvatarStyles = function euiAvatarStyles(_ref8) {
101
97
  capitalize: _ref4,
102
98
  uppercase: _ref3,
103
99
  lowercase: _ref2,
104
- none: _ref
100
+ none: _ref,
101
+ tooltip: {
102
+ user: /*#__PURE__*/css("border-radius:", borderRadius.user, ";;label:user;"),
103
+ space: /*#__PURE__*/css("border-radius:", borderRadius.space, ";;label:space;")
104
+ }
105
105
  };
106
106
  };
@@ -48,8 +48,7 @@ export var EuiBanner = /*#__PURE__*/forwardRef(function (_ref, ref) {
48
48
  var headingSize = size === 's' ? 'xxs' : 'xs';
49
49
  var primaryActionProps = actionProps === null || actionProps === void 0 ? void 0 : actionProps.primary;
50
50
  var secondaryActionProps = actionProps === null || actionProps === void 0 ? void 0 : actionProps.secondary;
51
- // a standalone secondary action is not supported
52
- var hasActions = Boolean(primaryActionProps);
51
+ var hasActions = Boolean(primaryActionProps) || Boolean(secondaryActionProps);
53
52
  var componentClass = 'euiBanner';
54
53
  var classes = classNames(componentClass, className);
55
54
  var backgroundColorStyles = useEuiBackgroundColorCSS()[color];
@@ -60,7 +60,7 @@ export var euiBannerStyles = function euiBannerStyles(_ref3) {
60
60
  }), ";;label:body;"),
61
61
  // At size `s` the content slot becomes a block container so the title and
62
62
  // text flow inline. Other sizes keep the flex column with a fixed gap.
63
- content: /*#__PURE__*/css("flex:1 1 auto;min-inline-size:0;max-inline-size:", TEXT_MAX_WIDTH, "px;display:flex;flex-direction:column;gap:", euiTheme.size.xs, ";[data-size='s'] &{display:block;>*+*:not(.euiButtonIcon){margin-block-start:", euiTheme.size.s, ";}};label:content;"),
63
+ content: /*#__PURE__*/css("flex:1 1 auto;min-inline-size:0;max-inline-size:", TEXT_MAX_WIDTH, "px;display:flex;flex-direction:column;gap:", euiTheme.size.xs, ";[data-size='s'] &{display:block;>*+*:not(.euiButtonIcon){margin-block-start:", euiTheme.size.s, ";}}[data-size='m'] &{>.euiText+*{margin-block-start:", euiTheme.size.s, ";}};label:content;"),
64
64
  title: _ref,
65
65
  text: /*#__PURE__*/css("[data-size='s'] &{display:inline;&::before{content:'\xB7';display:inline-block;inline-size:calc(", euiTheme.size.s, " + ", euiTheme.size.xxs, ");text-align:center;color:", euiTheme.colors.textHeading, ";}};label:text;"),
66
66
  actions: /*#__PURE__*/css("display:flex;flex-direction:row;align-items:center;flex-wrap:nowrap;gap:", euiTheme.size.s, ";@container ", CONTAINER_NAME, " ", CQC_BREAKPOINT_NARROWEST, "{flex-wrap:wrap;>*{inline-size:100%;}}", withContainerQuery({
@@ -8,7 +8,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
8
8
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
9
9
  import _inherits from "@babel/runtime/helpers/inherits";
10
10
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
11
- var _excluded = ["className", "loading", "items", "itemId", "columns", "pagination", "sorting", "selection", "onChange", "error", "noItemsMessage", "compressed", "itemIdToExpandedRowMap", "responsiveBreakpoint", "rowProps", "cellProps", "tableCaption", "rowHeader", "tableLayout", "hasBackground", "scrollableInline", "stickyScrollbar", "stickyHeader"],
11
+ var _excluded = ["className", "loading", "items", "itemId", "columns", "pagination", "sorting", "selection", "onChange", "error", "noItemsMessage", "compressed", "itemIdToExpandedRowMap", "responsiveBreakpoint", "rowProps", "cellProps", "tableCaption", "rowHeader", "tableLayout", "hasBackground", "scrollableInline", "stickyScrollbar", "stickyHeader", "panelled"],
12
12
  _excluded2 = ["align", "render", "dataType", "isExpander", "textOnly", "name", "field", "description", "sortable", "footer", "mobileOptions", "nameTooltip"];
13
13
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
14
14
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -40,7 +40,7 @@ import { EuiScreenReaderOnly } from '../accessibility';
40
40
  import { EuiI18n } from '../i18n';
41
41
  import { EuiDelayRender } from '../delay_render';
42
42
  import { htmlIdGenerator } from '../../services/accessibility';
43
- import { euiBasicTableBodyLoading, safariLoadingWorkaround } from './basic_table.styles';
43
+ import { euiBasicTableBodyLoading, euiBasicTableWrapperPanelledStyles, safariLoadingWorkaround } from './basic_table.styles';
44
44
  import { EuiToolTip } from '../tool_tip';
45
45
  import { jsx as ___EmotionJSX } from "@emotion/react";
46
46
  var dataTypesProfiles = {
@@ -360,6 +360,7 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
360
360
  scrollableInline = _this$props2.scrollableInline,
361
361
  stickyScrollbar = _this$props2.stickyScrollbar,
362
362
  stickyHeader = _this$props2.stickyHeader,
363
+ panelled = _this$props2.panelled,
363
364
  rest = _objectWithoutProperties(_this$props2, _excluded);
364
365
  var classes = classNames('euiBasicTable', {
365
366
  'euiBasicTable-loading': loading
@@ -381,8 +382,9 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
381
382
  loading = _this$props3.loading,
382
383
  scrollableInline = _this$props3.scrollableInline,
383
384
  stickyScrollbar = _this$props3.stickyScrollbar,
384
- stickyHeader = _this$props3.stickyHeader;
385
- return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiTableHeaderMobile, {
385
+ stickyHeader = _this$props3.stickyHeader,
386
+ panelled = _this$props3.panelled;
387
+ var content = ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiTableHeaderMobile, {
386
388
  responsiveBreakpoint: responsiveBreakpoint
387
389
  }, this.renderSelectAll(true), this.renderTableMobileSort()), ___EmotionJSX(OverrideCopiedTabularContent, null, ___EmotionJSX(EuiTable, {
388
390
  id: this.tableId,
@@ -395,6 +397,13 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
395
397
  stickyHeader: stickyHeader,
396
398
  css: loading && safariLoadingWorkaround
397
399
  }, this.renderTableCaption(), this.renderTableHead(), this.renderTableBody(), this.renderTableFooter())));
400
+ if (panelled) {
401
+ return ___EmotionJSX("div", {
402
+ css: panelled && euiBasicTableWrapperPanelledStyles(responsiveBreakpoint),
403
+ "data-test-subj": "euiBasicTablePanelledWrapper"
404
+ }, content);
405
+ }
406
+ return content;
398
407
  }
399
408
  }, {
400
409
  key: "renderTableMobileSort",
@@ -951,7 +960,9 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
951
960
  error = _this$props11.error,
952
961
  pagination = _this$props11.pagination,
953
962
  tableCaption = _this$props11.tableCaption,
954
- onChange = _this$props11.onChange;
963
+ onChange = _this$props11.onChange,
964
+ panelled = _this$props11.panelled,
965
+ responsiveBreakpoint = _this$props11.responsiveBreakpoint;
955
966
  if (!error && pagination && pagination.totalItemCount > 0) {
956
967
  if (!onChange) {
957
968
  throw new Error("The Basic Table is configured with pagination but [onChange] is\n not configured. This callback must be implemented to handle pagination changes");
@@ -965,6 +976,8 @@ export var EuiBasicTable = /*#__PURE__*/function (_Component) {
965
976
  }, function (tablePagination) {
966
977
  return ___EmotionJSX(PaginationBar, {
967
978
  pagination: pagination,
979
+ panelled: panelled,
980
+ responsiveBreakpoint: responsiveBreakpoint,
968
981
  onPageSizeChange: _this7.onPageSizeChange.bind(_this7),
969
982
  onPageChange: _this7.onPageChange.bind(_this7),
970
983
  "aria-controls": _this7.tableId,
@@ -10,7 +10,8 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
10
10
  */
11
11
 
12
12
  import { css, keyframes } from '@emotion/react';
13
- import { logicalCSS, euiCantAnimate, highContrastModeStyles, preventForcedColors } from '../../global_styling';
13
+ import { logicalCSS, euiCantAnimate, highContrastModeStyles, preventForcedColors, euiMinBreakpoint } from '../../global_styling';
14
+ import { EUI_BASIC_TABLE_PANEL_CLASS_NAME } from './use_panel_props';
14
15
  var tableLoadingLine = keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n from {\n ", "\n ", "\n }\n\n 20% {\n ", "\n ", "\n }\n\n 80% {\n ", "\n ", "\n }\n\n 100% {\n ", "\n ", "\n }\n"])), logicalCSS('left', 0), logicalCSS('width', 0), logicalCSS('left', 0), logicalCSS('width', '40%'), logicalCSS('left', '60%'), logicalCSS('width', '40%'), logicalCSS('left', '100%'), logicalCSS('width', 0));
15
16
  export var euiBasicTableBodyLoading = function euiBasicTableBodyLoading(euiThemeContext) {
16
17
  var euiTheme = euiThemeContext.euiTheme;
@@ -19,6 +20,23 @@ export var euiBasicTableBodyLoading = function euiBasicTableBodyLoading(euiTheme
19
20
  }), ";}};label:euiBasicTableBodyLoading;");
20
21
  };
21
22
 
23
+ /**
24
+ * @internal
25
+ */
26
+ export var euiBasicTableWrapperPanelledStyles = function euiBasicTableWrapperPanelledStyles(responsiveBreakpoint) {
27
+ return function (theme) {
28
+ var euiTheme = theme.euiTheme;
29
+ var styles = /*#__PURE__*/css("border:", euiTheme.border.thin, ";border-block-end-width:0;padding-block-start:", euiTheme.border.width.thin, ";border-radius:", euiTheme.border.radius.medium, ";.euiTable{border-radius:", euiTheme.border.radius.medium, ";}.", EUI_BASIC_TABLE_PANEL_CLASS_NAME, "+.euiBasicTable &{border-start-start-radius:0;border-start-end-radius:0;.euiTable{border-start-start-radius:0;border-start-end-radius:0;}}&:not(:last-child),&:has(+ .", EUI_BASIC_TABLE_PANEL_CLASS_NAME, "){border-end-start-radius:0;border-end-end-radius:0;.euiTable{border-end-start-radius:0;border-end-end-radius:0;}};label:styles;");
30
+ if (responsiveBreakpoint === true) {
31
+ return null;
32
+ }
33
+ if (!responsiveBreakpoint) {
34
+ return styles;
35
+ }
36
+ return /*#__PURE__*/css(euiMinBreakpoint(theme, responsiveBreakpoint), "{", styles, ";};label:euiBasicTableWrapperPanelledStyles;");
37
+ };
38
+ };
39
+
22
40
  // Fix to make the loading indicator position correctly in Safari
23
41
  // For whatever annoying reason, Safari doesn't respect `position: relative;`
24
42
  // on `tbody` without `position: relative` on the parent `table`
@@ -7,4 +7,5 @@
7
7
  */
8
8
 
9
9
  export { EuiBasicTable } from './basic_table';
10
- export { EuiInMemoryTable } from './in_memory_table';
10
+ export { EuiInMemoryTable } from './in_memory_table';
11
+ export { useEuiBasicTablePanelProps } from './use_panel_props';
@@ -7,11 +7,24 @@
7
7
  */
8
8
 
9
9
  import React, { useEffect } from 'react';
10
- import { EuiSpacer } from '../spacer';
10
+ import { useEuiMemoizedStyles } from '../../services';
11
11
  import { EuiTablePagination, useEuiTablePaginationDefaults } from '../table/table_pagination';
12
+ import { useIsEuiTableResponsive } from '../table/mobile/responsive_context';
13
+ import { euiBasicTablePaginationBarStyles } from './pagination_bar.styles';
14
+
15
+ /**
16
+ * @internal
17
+ */
12
18
  import { jsx as ___EmotionJSX } from "@emotion/react";
19
+ /**
20
+ * An internal utility component that renders EuiTablePagination with
21
+ * proper configuration and handles the `panelled` styles.
22
+ * @internal
23
+ */
13
24
  export var PaginationBar = function PaginationBar(_ref) {
14
25
  var pagination = _ref.pagination,
26
+ panelled = _ref.panelled,
27
+ responsiveBreakpoint = _ref.responsiveBreakpoint,
15
28
  onPageSizeChange = _ref.onPageSizeChange,
16
29
  onPageChange = _ref.onPageChange,
17
30
  ariaControls = _ref['aria-controls'],
@@ -26,14 +39,16 @@ export var PaginationBar = function PaginationBar(_ref) {
26
39
  _pagination$showPerPa = pagination.showPerPageOptions,
27
40
  showPerPageOptions = _pagination$showPerPa === void 0 ? defaults.showPerPageOptions : _pagination$showPerPa;
28
41
  var pageCount = pageSize ? Math.ceil(totalItemCount / pageSize) : 1;
42
+ var styles = useEuiMemoizedStyles(euiBasicTablePaginationBarStyles);
43
+ var isResponsive = useIsEuiTableResponsive(responsiveBreakpoint);
29
44
  useEffect(function () {
30
45
  if (pageCount < pageIndex + 1) {
31
46
  onPageChange === null || onPageChange === void 0 || onPageChange(pageCount - 1);
32
47
  }
33
48
  }, [pageCount, onPageChange, pageIndex]);
34
- return ___EmotionJSX("div", null, ___EmotionJSX(EuiSpacer, {
35
- size: "m"
36
- }), ___EmotionJSX(EuiTablePagination, {
49
+ return ___EmotionJSX("div", {
50
+ css: [styles.root, !isResponsive && panelled && styles.panelled, ";label:PaginationBar;"]
51
+ }, ___EmotionJSX(EuiTablePagination, {
37
52
  activePage: pageIndex,
38
53
  showPerPageOptions: showPerPageOptions,
39
54
  itemsPerPage: pageSize,
@@ -0,0 +1,21 @@
1
+ /*
2
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+ * or more contributor license agreements. Licensed under the Elastic License
4
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
5
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
6
+ * Side Public License, v 1.
7
+ */
8
+
9
+ import { css } from '@emotion/react';
10
+ import { logicalShorthandCSS } from '../../global_styling';
11
+
12
+ /**
13
+ * @internal
14
+ */
15
+ export var euiBasicTablePaginationBarStyles = function euiBasicTablePaginationBarStyles(theme) {
16
+ var euiTheme = theme.euiTheme;
17
+ return {
18
+ root: /*#__PURE__*/css(logicalShorthandCSS('padding', "".concat(euiTheme.size.xs, " ").concat(euiTheme.size.s)), ";;label:root;"),
19
+ panelled: /*#__PURE__*/css("background:", euiTheme.colors.backgroundBaseSubdued, ";border:", euiTheme.border.thin, ";border-block-start-width:0;", logicalShorthandCSS('border-radius', "0 0 ".concat(euiTheme.border.radius.medium, " ").concat(euiTheme.border.radius.medium)), ";;label:panelled;")
20
+ };
21
+ };
@@ -0,0 +1,14 @@
1
+ /*
2
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+ * or more contributor license agreements. Licensed under the Elastic License
4
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
5
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
6
+ * Side Public License, v 1.
7
+ */
8
+
9
+ import { css } from '@emotion/react';
10
+ import { logicalShorthandCSS } from '../../global_styling';
11
+ export var euiBasicTablePanelStyles = function euiBasicTablePanelStyles(_ref) {
12
+ var euiTheme = _ref.euiTheme;
13
+ return /*#__PURE__*/css("background-color:", euiTheme.colors.backgroundBaseSubdued, ";border:", euiTheme.border.thin, ";border-block-end-width:0;", logicalShorthandCSS('border-radius', "".concat(euiTheme.border.radius.medium, " ").concat(euiTheme.border.radius.medium, " 0 0")), "&+&{border-start-start-radius:0;border-start-end-radius:0;};label:euiBasicTablePanelStyles;");
14
+ };
@@ -0,0 +1,28 @@
1
+ /*
2
+ * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
3
+ * or more contributor license agreements. Licensed under the Elastic License
4
+ * 2.0 and the Server Side Public License, v 1; you may not use this file except
5
+ * in compliance with, at your election, the Elastic License 2.0 or the Server
6
+ * Side Public License, v 1.
7
+ */
8
+
9
+ import { useEuiMemoizedStyles } from '../../services';
10
+ import { euiBasicTablePanelStyles } from './panel.styles';
11
+
12
+ /**
13
+ * @internal
14
+ */
15
+ export var EUI_BASIC_TABLE_PANEL_CLASS_NAME = 'euiBasicTablePanel';
16
+
17
+ /**
18
+ * A utility hook that returns props needed to be passed to element(s) being
19
+ * a part of the paneled table look and feel (e.g., a toolbar above the table).
20
+ * @beta
21
+ */
22
+ export var useEuiBasicTablePanelProps = function useEuiBasicTablePanelProps() {
23
+ var css = useEuiMemoizedStyles(euiBasicTablePanelStyles);
24
+ return {
25
+ css: css,
26
+ className: EUI_BASIC_TABLE_PANEL_CLASS_NAME
27
+ };
28
+ };