@elastic/eui 95.12.0 → 96.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 (101) hide show
  1. package/es/components/breadcrumbs/_breadcrumb_content.js +2 -0
  2. package/es/components/breadcrumbs/breadcrumbs.js +2 -0
  3. package/es/components/datagrid/body/cell/data_grid_cell.styles.js +3 -1
  4. package/es/components/datagrid/controls/column_selector.js +2 -2
  5. package/es/components/datagrid/controls/column_selector.styles.js +2 -2
  6. package/es/components/datagrid/controls/column_sorting.js +0 -1
  7. package/es/components/datagrid/controls/column_sorting.styles.js +2 -2
  8. package/es/components/datagrid/controls/column_sorting_draggable.js +2 -1
  9. package/es/components/drag_and_drop/draggable.js +15 -2
  10. package/es/components/header/header_breadcrumbs/header_breadcrumbs.js +2 -0
  11. package/es/components/header/header_links/header_links.js +2 -0
  12. package/es/components/page/page_header/page_header_content.js +32 -31
  13. package/es/components/page/page_header/page_header_content.styles.js +28 -16
  14. package/es/components/popover/popover.js +2 -0
  15. package/es/components/provider/system_color_mode/system_color_mode_provider.js +3 -3
  16. package/es/components/search_bar/search_box.js +2 -3
  17. package/es/components/tour/tour_step.js +2 -0
  18. package/eui.d.ts +23 -6
  19. package/i18ntokens.json +56 -56
  20. package/lib/components/breadcrumbs/_breadcrumb_content.js +2 -0
  21. package/lib/components/datagrid/body/cell/data_grid_cell.styles.js +3 -1
  22. package/lib/components/datagrid/controls/column_selector.js +2 -2
  23. package/lib/components/datagrid/controls/column_selector.styles.js +1 -1
  24. package/lib/components/datagrid/controls/column_sorting.js +0 -1
  25. package/lib/components/datagrid/controls/column_sorting.styles.js +1 -1
  26. package/lib/components/datagrid/controls/column_sorting_draggable.js +2 -1
  27. package/lib/components/drag_and_drop/draggable.js +15 -2
  28. package/lib/components/page/page_header/page_header_content.js +29 -30
  29. package/lib/components/page/page_header/page_header_content.styles.js +28 -16
  30. package/lib/components/popover/popover.js +2 -0
  31. package/lib/components/provider/system_color_mode/system_color_mode_provider.js +3 -3
  32. package/lib/components/search_bar/search_box.js +1 -2
  33. package/optimize/es/components/datagrid/body/cell/data_grid_cell.styles.js +3 -1
  34. package/optimize/es/components/datagrid/controls/column_selector.js +2 -2
  35. package/optimize/es/components/datagrid/controls/column_selector.styles.js +2 -2
  36. package/optimize/es/components/datagrid/controls/column_sorting.js +0 -1
  37. package/optimize/es/components/datagrid/controls/column_sorting.styles.js +2 -2
  38. package/optimize/es/components/datagrid/controls/column_sorting_draggable.js +2 -1
  39. package/optimize/es/components/drag_and_drop/draggable.js +6 -2
  40. package/optimize/es/components/page/page_header/page_header_content.js +26 -28
  41. package/optimize/es/components/page/page_header/page_header_content.styles.js +28 -16
  42. package/optimize/es/components/provider/system_color_mode/system_color_mode_provider.js +3 -3
  43. package/optimize/es/components/search_bar/search_box.js +2 -3
  44. package/optimize/lib/components/datagrid/body/cell/data_grid_cell.styles.js +3 -1
  45. package/optimize/lib/components/datagrid/controls/column_selector.js +2 -2
  46. package/optimize/lib/components/datagrid/controls/column_selector.styles.js +1 -1
  47. package/optimize/lib/components/datagrid/controls/column_sorting.js +0 -1
  48. package/optimize/lib/components/datagrid/controls/column_sorting.styles.js +1 -1
  49. package/optimize/lib/components/datagrid/controls/column_sorting_draggable.js +2 -1
  50. package/optimize/lib/components/drag_and_drop/draggable.js +6 -2
  51. package/optimize/lib/components/page/page_header/page_header_content.js +25 -27
  52. package/optimize/lib/components/page/page_header/page_header_content.styles.js +28 -16
  53. package/optimize/lib/components/provider/system_color_mode/system_color_mode_provider.js +3 -3
  54. package/optimize/lib/components/search_bar/search_box.js +1 -2
  55. package/package.json +1 -1
  56. package/src/global_styling/mixins/_index.scss +1 -7
  57. package/src/global_styling/mixins/_states.scss +0 -33
  58. package/src/global_styling/mixins/_tool_tip.scss +4 -11
  59. package/src/global_styling/variables/_buttons.scss +4 -5
  60. package/src/global_styling/variables/_form.scss +0 -38
  61. package/src/global_styling/variables/_index.scss +0 -3
  62. package/src/themes/amsterdam/global_styling/mixins/_index.scss +1 -7
  63. package/src/themes/amsterdam/global_styling/mixins/_states.scss +0 -33
  64. package/src/themes/amsterdam/global_styling/variables/_index.scss +0 -2
  65. package/test-env/components/breadcrumbs/_breadcrumb_content.js +2 -0
  66. package/test-env/components/datagrid/body/cell/data_grid_cell.styles.js +3 -1
  67. package/test-env/components/datagrid/controls/column_selector.js +2 -2
  68. package/test-env/components/datagrid/controls/column_selector.styles.js +1 -1
  69. package/test-env/components/datagrid/controls/column_sorting.js +0 -1
  70. package/test-env/components/datagrid/controls/column_sorting.styles.js +1 -1
  71. package/test-env/components/datagrid/controls/column_sorting_draggable.js +2 -1
  72. package/test-env/components/drag_and_drop/draggable.js +15 -2
  73. package/test-env/components/page/page_header/page_header_content.js +29 -30
  74. package/test-env/components/page/page_header/page_header_content.styles.js +28 -16
  75. package/test-env/components/popover/popover.js +2 -0
  76. package/test-env/components/provider/system_color_mode/system_color_mode_provider.js +3 -3
  77. package/test-env/components/search_bar/search_box.js +1 -2
  78. package/dist/eui_theme_dark.css +0 -173
  79. package/dist/eui_theme_dark.min.css +0 -1
  80. package/dist/eui_theme_light.css +0 -173
  81. package/dist/eui_theme_light.min.css +0 -1
  82. package/src/global_styling/mixins/_button.scss +0 -149
  83. package/src/global_styling/mixins/_form.scss +0 -273
  84. package/src/global_styling/mixins/_link.scss +0 -11
  85. package/src/global_styling/mixins/_loading.scss +0 -6
  86. package/src/global_styling/mixins/_panel.scss +0 -55
  87. package/src/global_styling/mixins/_range.scss +0 -62
  88. package/src/global_styling/variables/_page.scss +0 -2
  89. package/src/global_styling/variables/_panel.scss +0 -21
  90. package/src/global_styling/variables/_tool_tip.scss +0 -9
  91. package/src/themes/amsterdam/global_styling/mixins/_link.scss +0 -23
  92. package/src/themes/amsterdam/global_styling/variables/_buttons.scss +0 -4
  93. package/src/themes/amsterdam/global_styling/variables/_page.scss +0 -1
  94. package/src/themes/legacy/_colors_dark.scss +0 -49
  95. package/src/themes/legacy/_colors_light.scss +0 -49
  96. package/src/themes/legacy/_globals.scss +0 -11
  97. package/src/themes/legacy/legacy_dark.scss +0 -11
  98. package/src/themes/legacy/legacy_light.scss +0 -11
  99. package/src/themes/legacy/reset/_index.scss +0 -2
  100. package/src/themes/legacy/reset/_reset.scss +0 -161
  101. package/src/themes/legacy/reset/_scrollbar.scss +0 -6
@@ -251,6 +251,8 @@ EuiBreadcrumbContent.propTypes = {
251
251
  /**
252
252
  * Must be set to true if using `EuiDragDropContext` within a popover,
253
253
  * otherwise your nested drag & drop will have incorrect positioning
254
+ *
255
+ * @deprecated - use `usePortal` prop on children `EuiDraggable` components instead.
254
256
  */
255
257
  hasDragDrop: PropTypes.bool,
256
258
  /**
@@ -264,6 +264,8 @@ EuiBreadcrumbs.propTypes = {
264
264
  /**
265
265
  * Must be set to true if using `EuiDragDropContext` within a popover,
266
266
  * otherwise your nested drag & drop will have incorrect positioning
267
+ *
268
+ * @deprecated - use `usePortal` prop on children `EuiDraggable` components instead.
267
269
  */
268
270
  hasDragDrop: PropTypes.bool,
269
271
  /**
@@ -104,7 +104,9 @@ export var euiDataGridRowCellStyles = function euiDataGridRowCellStyles(euiTheme
104
104
  defaultHeight: /*#__PURE__*/css(logicalCSS('height', '100%'), ";;label:defaultHeight;"),
105
105
  // Control columns should be vertically centered with the *first line* of text
106
106
  // for both single and multi-line heights (see https://github.com/elastic/eui/issues/7897)
107
- controlColumn: /*#__PURE__*/css("display:inline-flex;align-items:start;gap:", euiTheme.size.xxs, ";vertical-align:-webkit-baseline-middle;vertical-align:-moz-middle-with-baseline;.euiDataGrid--fontSizeSmall &:where(.euiDataGridRowCell__content--defaultHeight){", logicalCSS('height', '100%'), " align-items:center;}.euiCheckbox:not(:has(label)){display:inline;.euiCheckbox__square{display:inline-flex;vertical-align:text-bottom;@supports (vertical-align: -moz-middle-with-baseline){vertical-align:sub;}}};label:controlColumn;")
107
+ controlColumn: /*#__PURE__*/css(
108
+ // ❗ For some reason Chromium browsers will scrollbar stutter without this :|||
109
+ logicalCSS('max-height', '100%'), " display:inline-flex;align-items:start;gap:", euiTheme.size.xxs, ";vertical-align:-webkit-baseline-middle;vertical-align:-moz-middle-with-baseline;.euiDataGrid--fontSizeSmall &:where(.euiDataGridRowCell__content--defaultHeight){", logicalCSS('height', '100%'), " align-items:center;}.euiCheckbox:not(:has(label)){display:inline;.euiCheckbox__square{display:inline-flex;vertical-align:text-bottom;@supports (vertical-align: -moz-middle-with-baseline){vertical-align:sub;}}};label:controlColumn;")
108
110
  }
109
111
  };
110
112
  };
@@ -102,7 +102,6 @@ export var useDataGridColumnSelector = function useDataGridColumnSelector(availa
102
102
  },
103
103
  anchorPosition: "downLeft",
104
104
  panelPaddingSize: "none",
105
- hasDragDrop: true,
106
105
  button: ___EmotionJSX(EuiDataGridToolbarControl, {
107
106
  badgeContent: numberOfHiddenFields > 0 ? "".concat(orderedVisibleColumns.length, "/").concat(availableColumns.length) : availableColumns.length,
108
107
  iconType: "tableDensityNormal",
@@ -146,7 +145,8 @@ export var useDataGridColumnSelector = function useDataGridColumnSelector(availa
146
145
  index: index,
147
146
  isDragDisabled: !isDragEnabled,
148
147
  hasInteractiveChildren: true,
149
- customDragHandle: true
148
+ customDragHandle: true,
149
+ usePortal: true
150
150
  }, function (provided, state) {
151
151
  return ___EmotionJSX("div", {
152
152
  css: styles.euiDataGridColumnSelector__item,
@@ -7,7 +7,7 @@
7
7
  */
8
8
 
9
9
  import { css } from '@emotion/react';
10
- import { euiYScroll, logicalCSS, mathWithUnits } from '../../../global_styling';
10
+ import { euiYScrollWithShadows, logicalCSS, mathWithUnits } from '../../../global_styling';
11
11
  import { euiShadowLarge } from '../../../themes';
12
12
  export var euiDataGridColumnSelectorStyles = function euiDataGridColumnSelectorStyles(euiThemeContext) {
13
13
  var euiTheme = euiThemeContext.euiTheme;
@@ -16,7 +16,7 @@ export var euiDataGridColumnSelectorStyles = function euiDataGridColumnSelectorS
16
16
  });
17
17
  var maxResponsiveHeight = "min(".concat(maxStaticHeight, ", 50vh)");
18
18
  return {
19
- euiDataGridColumnSelector: /*#__PURE__*/css(euiYScroll(euiThemeContext), " ", logicalCSS('max-height', maxResponsiveHeight), " padding:", euiTheme.size.s, ";;label:euiDataGridColumnSelector;"),
19
+ euiDataGridColumnSelector: /*#__PURE__*/css(euiYScrollWithShadows(euiThemeContext), " ", logicalCSS('max-height', maxResponsiveHeight), " padding:", euiTheme.size.s, ";;label:euiDataGridColumnSelector;"),
20
20
  euiDataGridColumnSelector__item: /*#__PURE__*/css("padding:", euiTheme.size.xs, ";&.euiDataGridColumnSelector__item-isDragging{", euiShadowLarge(euiThemeContext), " background-color:", euiTheme.colors.emptyShade, ";};label:euiDataGridColumnSelector__item;")
21
21
  };
22
22
  };
@@ -142,7 +142,6 @@ export var DataGridSortingControl = /*#__PURE__*/memo(function (_ref2) {
142
142
  },
143
143
  anchorPosition: "downLeft",
144
144
  panelPaddingSize: "s",
145
- hasDragDrop: true,
146
145
  button: ___EmotionJSX(EuiDataGridToolbarControl, {
147
146
  badgeContent: sorting.columns.length,
148
147
  iconType: "sortable",
@@ -7,7 +7,7 @@
7
7
  */
8
8
 
9
9
  import { css } from '@emotion/react';
10
- import { euiFontSize, euiMinBreakpoint, euiYScroll, logicalCSS, mathWithUnits } from '../../../global_styling';
10
+ import { euiFontSize, euiMinBreakpoint, euiYScroll, euiYScrollWithShadows, logicalCSS, mathWithUnits } from '../../../global_styling';
11
11
  import { euiShadowLarge } from '../../../themes';
12
12
  export var euiDataGridColumnSortingStyles = function euiDataGridColumnSortingStyles(euiThemeContext) {
13
13
  var euiTheme = euiThemeContext.euiTheme;
@@ -19,7 +19,7 @@ export var euiDataGridColumnSortingStyles = function euiDataGridColumnSortingSty
19
19
  /**
20
20
  * Sorted fields
21
21
  */
22
- euiDataGridColumnSorting: /*#__PURE__*/css(logicalCSS('max-height', maxResponsiveHeight), " ", logicalCSS('padding-vertical', euiTheme.size.s), "margin:-", euiTheme.size.s, ";", euiYScroll(euiThemeContext), ";;label:euiDataGridColumnSorting;"),
22
+ euiDataGridColumnSorting: /*#__PURE__*/css(logicalCSS('max-height', maxResponsiveHeight), " ", logicalCSS('padding-vertical', euiTheme.size.s), "margin:-", euiTheme.size.s, ";", euiYScrollWithShadows(euiThemeContext), ";;label:euiDataGridColumnSorting;"),
23
23
  euiDataGridColumnSorting__item: /*#__PURE__*/css(logicalCSS('padding-horizontal', euiTheme.size.s), " &.euiDataGridColumnSorting__item-isDragging{", euiShadowLarge(euiThemeContext), " background-color:", euiTheme.colors.emptyShade, ";};label:euiDataGridColumnSorting__item;"),
24
24
  euiDataGridColumnSorting__name: /*#__PURE__*/css(logicalCSS('padding-right', euiTheme.size.xs), " ", euiMinBreakpoint(euiThemeContext, 'm'), "{", logicalCSS('padding-right', euiTheme.size.l), ";};label:euiDataGridColumnSorting__name;"),
25
25
  euiDataGridColumnSorting__order: /*#__PURE__*/css(euiMinBreakpoint(euiThemeContext, 'm'), "{", logicalCSS('min-width', mathWithUnits(euiTheme.size.xxl, function (x) {
@@ -89,7 +89,8 @@ export var EuiDataGridColumnSortingDraggable = function EuiDataGridColumnSorting
89
89
  draggableId: id,
90
90
  index: index,
91
91
  hasInteractiveChildren: true,
92
- customDragHandle: true
92
+ customDragHandle: true,
93
+ usePortal: true
93
94
  }, rest), function (provided, state) {
94
95
  return ___EmotionJSX(EuiFlexGroup, {
95
96
  css: styles.euiDataGridColumnSorting__item,
@@ -1,5 +1,5 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["customDragHandle", "draggableId", "isDragDisabled", "hasInteractiveChildren", "isRemovable", "index", "children", "className", "spacing", "style", "data-test-subj"];
2
+ var _excluded = ["customDragHandle", "draggableId", "isDragDisabled", "hasInteractiveChildren", "isRemovable", "usePortal", "index", "children", "className", "spacing", "style", "data-test-subj"];
3
3
  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); }
4
4
  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; }
5
5
  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; }
@@ -23,6 +23,7 @@ import classNames from 'classnames';
23
23
  import { useEuiTheme, cloneElementWithCss } from '../../services';
24
24
  import { EuiDroppableContext } from './droppable';
25
25
  import { euiDraggableStyles, euiDraggableItemStyles } from './draggable.styles';
26
+ import { EuiPortal } from '../portal';
26
27
  import { jsx as ___EmotionJSX } from "@emotion/react";
27
28
  export var EuiDraggable = function EuiDraggable(_ref) {
28
29
  var _ref$customDragHandle = _ref.customDragHandle,
@@ -34,6 +35,8 @@ export var EuiDraggable = function EuiDraggable(_ref) {
34
35
  hasInteractiveChildren = _ref$hasInteractiveCh === void 0 ? false : _ref$hasInteractiveCh,
35
36
  _ref$isRemovable = _ref.isRemovable,
36
37
  isRemovable = _ref$isRemovable === void 0 ? false : _ref$isRemovable,
38
+ _ref$usePortal = _ref.usePortal,
39
+ usePortal = _ref$usePortal === void 0 ? false : _ref$usePortal,
37
40
  index = _ref.index,
38
41
  children = _ref.children,
39
42
  className = _ref.className,
@@ -60,7 +63,7 @@ export var EuiDraggable = function EuiDraggable(_ref) {
60
63
  'euiDraggable__item-isDisabled': isDragDisabled
61
64
  });
62
65
  var DraggableElement = typeof children === 'function' ? children(provided, snapshot, rubric) : children;
63
- return ___EmotionJSX(React.Fragment, null, ___EmotionJSX("div", _extends({}, provided.draggableProps, !customDragHandle ? provided.dragHandleProps : {}, {
66
+ var content = ___EmotionJSX(React.Fragment, null, ___EmotionJSX("div", _extends({}, provided.draggableProps, !customDragHandle ? provided.dragHandleProps : {}, {
64
67
  ref: provided.innerRef,
65
68
  "data-test-subj": dataTestSubj,
66
69
  className: classes,
@@ -82,6 +85,7 @@ export var EuiDraggable = function EuiDraggable(_ref) {
82
85
  className: classNames(classes, 'euiDraggable--clone'),
83
86
  css: cssStyles
84
87
  }, DraggableElement));
88
+ return isDragging && usePortal ? ___EmotionJSX(EuiPortal, null, content) : content;
85
89
  });
86
90
  };
87
91
  EuiDraggable.propTypes = {
@@ -103,6 +107,15 @@ EuiDraggable.propTypes = {
103
107
  * Whether the item is currently in a position to be removed
104
108
  */
105
109
  isRemovable: PropTypes.bool,
110
+ /**
111
+ * Whether the currently dragged item is cloned into a portal in the body. This settings will
112
+ * ensure that drag & drop still works as expected within stacking contexts (e.g. within `EuiFlyout`,
113
+ * `EuiModal` and `EuiPopover`).
114
+ *
115
+ * Make sure to apply styles directly to the Draggable content as relative styling from an outside
116
+ * scope might not be applied when the content is placed in a portal as the DOM structure changes.
117
+ */
118
+ usePortal: PropTypes.bool,
106
119
  /**
107
120
  * Adds padding to the draggable item
108
121
  */
@@ -210,6 +210,8 @@ EuiHeaderBreadcrumbs.propTypes = {
210
210
  /**
211
211
  * Must be set to true if using `EuiDragDropContext` within a popover,
212
212
  * otherwise your nested drag & drop will have incorrect positioning
213
+ *
214
+ * @deprecated - use `usePortal` prop on children `EuiDraggable` components instead.
213
215
  */
214
216
  hasDragDrop: PropTypes.bool,
215
217
  /**
@@ -249,6 +249,8 @@ EuiHeaderLinks.propTypes = {
249
249
  /**
250
250
  * Must be set to true if using `EuiDragDropContext` within a popover,
251
251
  * otherwise your nested drag & drop will have incorrect positioning
252
+ *
253
+ * @deprecated - use `usePortal` prop on children `EuiDraggable` components instead.
252
254
  */
253
255
  hasDragDrop: PropTypes.bool,
254
256
  /**
@@ -26,7 +26,7 @@ import { EuiFlexGroup, EuiFlexItem } from '../../flex';
26
26
  import { EuiSpacer } from '../../spacer';
27
27
  import { EuiTitle } from '../../title';
28
28
  import { EuiText } from '../../text';
29
- import { useIsWithinBreakpoints, useEuiTheme } from '../../../services';
29
+ import { useIsWithinBreakpoints, useEuiMemoizedStyles } from '../../../services';
30
30
  import { EuiScreenReaderOnly } from '../../accessibility';
31
31
  import { EuiBreadcrumbs } from '../../breadcrumbs';
32
32
  import { useEuiPaddingCSS } from '../../../global_styling';
@@ -68,10 +68,9 @@ export var EuiPageHeaderContent = function EuiPageHeaderContent(_ref) {
68
68
  style = _ref.style,
69
69
  rest = _objectWithoutProperties(_ref, _excluded);
70
70
  var isResponsiveBreakpoint = useIsWithinBreakpoints(['xs', 's'], !!responsive);
71
- var useTheme = useEuiTheme();
72
71
  var classes = classNames('euiPageHeaderContent', className);
73
- var pageHeaderStyles = euiPageHeaderStyles(useTheme);
74
- var contentStyles = euiPageHeaderContentStyles(useTheme);
72
+ var pageHeaderStyles = useEuiMemoizedStyles(euiPageHeaderStyles);
73
+ var contentStyles = useEuiMemoizedStyles(euiPageHeaderContentStyles);
75
74
  var styles = setStyleForRestrictedPageWidth(restrictWidth, style);
76
75
  var paddingSides = 'vertical';
77
76
  var paddingSize = _paddingSize;
@@ -94,7 +93,7 @@ export var EuiPageHeaderContent = function EuiPageHeaderContent(_ref) {
94
93
  }
95
94
  var blockPadding = useEuiPaddingCSS(paddingSides);
96
95
  var cssStyles = [contentStyles.euiPageHeaderContent, bottomBorder && pageHeaderStyles.border, blockPadding[paddingSize]];
97
- var childrenOnlyStyles = [contentStyles.flex, contentStyles[alignItems || 'center'], responsive === true && isResponsiveBreakpoint && contentStyles.responsive, responsive === 'reverse' && isResponsiveBreakpoint && contentStyles.responsiveReverse];
96
+ var childrenOnlyStyles = [contentStyles.childrenOnly.flex, contentStyles[alignItems || 'center'], isResponsiveBreakpoint && responsive && (responsive === 'reverse' ? contentStyles.childrenOnly.responsiveReverse : contentStyles.childrenOnly.responsive)];
98
97
 
99
98
  // Don't go any further if there's no other content than children
100
99
  if (onlyChildren) {
@@ -153,10 +152,10 @@ export var EuiPageHeaderContent = function EuiPageHeaderContent(_ref) {
153
152
  }
154
153
  var childrenNode = children && ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiSpacer, null), children);
155
154
  var bottomContentNode;
156
- if (childrenNode || tabsNode && pageTitleNode) {
155
+ if (tabsNode && pageTitleNode) {
157
156
  bottomContentNode = ___EmotionJSX("div", {
158
157
  className: "euiPageHeaderContent__bottom"
159
- }, childrenNode, pageTitleNode && tabsNode);
158
+ }, pageTitleNode && tabsNode);
160
159
  }
161
160
 
162
161
  /**
@@ -165,10 +164,14 @@ export var EuiPageHeaderContent = function EuiPageHeaderContent(_ref) {
165
164
  */
166
165
  var leftSideOrder;
167
166
  if (tabsNode && !pageTitleNode) {
168
- leftSideOrder = ___EmotionJSX(React.Fragment, null, tabsNode, descriptionNode);
167
+ leftSideOrder = ___EmotionJSX(React.Fragment, null, tabsNode, descriptionNode, childrenNode);
169
168
  } else {
170
- leftSideOrder = ___EmotionJSX(React.Fragment, null, pageTitleNode, descriptionNode);
169
+ leftSideOrder = ___EmotionJSX(React.Fragment, null, pageTitleNode, descriptionNode, childrenNode);
171
170
  }
171
+ var leftSideFlexItem = ___EmotionJSX(EuiFlexItem, {
172
+ grow: 2,
173
+ css: contentStyles.euiPageHeaderContent__leftSideItems
174
+ }, leftSideOrder);
172
175
  var rightSideFlexItem;
173
176
  if (rightSideItems && rightSideItems.length) {
174
177
  var itemsToRender = isResponsiveBreakpoint ? rightSideItems : _toConsumableArray(rightSideItems).reverse();
@@ -178,32 +181,27 @@ export var EuiPageHeaderContent = function EuiPageHeaderContent(_ref) {
178
181
  key: index
179
182
  }, item);
180
183
  });
181
- rightSideFlexItem = ___EmotionJSX(EuiFlexItem, {
182
- grow: false
183
- }, ___EmotionJSX(EuiFlexGroup, _extends({
184
- wrap: true,
185
- responsive: false
186
- }, rightSideGroupProps), rightSideFlexItems));
184
+ var _cssStyles = [contentStyles.euiPageHeaderContent__rightSideItems, rightSideGroupProps === null || rightSideGroupProps === void 0 ? void 0 : rightSideGroupProps.css];
185
+ rightSideFlexItem = ___EmotionJSX(EuiFlexGroup, _extends({
186
+ gutterSize: "l",
187
+ responsive: false,
188
+ wrap: true
189
+ }, rightSideGroupProps, {
190
+ css: _cssStyles
191
+ }), rightSideFlexItems);
187
192
  }
188
- return alignItems === 'top' || isResponsiveBreakpoint ? ___EmotionJSX("div", _extends({
189
- className: classes,
190
- css: cssStyles,
191
- style: styles
192
- }, rest), optionalBreadcrumbs, ___EmotionJSX(EuiFlexGroup, {
193
- responsive: !!responsive,
194
- className: "euiPageHeaderContent__top",
195
- alignItems: pageTitle ? 'flexStart' : 'baseline',
196
- gutterSize: "l"
197
- }, isResponsiveBreakpoint && responsive === 'reverse' ? ___EmotionJSX(React.Fragment, null, rightSideFlexItem, ___EmotionJSX(EuiFlexItem, null, leftSideOrder)) : ___EmotionJSX(React.Fragment, null, ___EmotionJSX(EuiFlexItem, null, leftSideOrder), rightSideFlexItem)), bottomContentNode) : ___EmotionJSX("div", _extends({
193
+ return ___EmotionJSX("div", _extends({
198
194
  className: classes,
199
195
  css: cssStyles,
200
196
  style: styles
201
197
  }, rest), optionalBreadcrumbs, ___EmotionJSX(EuiFlexGroup, {
202
198
  responsive: !!responsive,
199
+ css: contentStyles.euiPageHeaderContent__top,
203
200
  className: "euiPageHeaderContent__top",
204
- alignItems: alignItems === 'bottom' ? 'flexEnd' : alignItems,
205
- gutterSize: "l"
206
- }, ___EmotionJSX(EuiFlexItem, null, leftSideOrder, bottomContentNode), rightSideFlexItem));
201
+ alignItems: alignItems === 'bottom' ? 'flexEnd' : alignItems === 'top' ? 'flexStart' : alignItems,
202
+ gutterSize: "l",
203
+ wrap: true
204
+ }, isResponsiveBreakpoint && responsive === 'reverse' ? ___EmotionJSX(React.Fragment, null, rightSideFlexItem, leftSideFlexItem) : ___EmotionJSX(React.Fragment, null, leftSideFlexItem, rightSideFlexItem)), bottomContentNode);
207
205
  };
208
206
  EuiPageHeaderContent.propTypes = {
209
207
  className: PropTypes.string,
@@ -211,7 +209,8 @@ EuiPageHeaderContent.propTypes = {
211
209
  "data-test-subj": PropTypes.string,
212
210
  css: PropTypes.any,
213
211
  /**
214
- * The only option is on/off
212
+ * If not set, defaults to true if `tabs` are passed and render at the bottom of the page.
213
+ * Otherwise, defaults to false.
215
214
  */
216
215
  bottomBorder: PropTypes.bool,
217
216
  /**
@@ -231,8 +230,8 @@ EuiPageHeaderContent.propTypes = {
231
230
  alignItems: PropTypes.any,
232
231
  /**
233
232
  * Pass custom an array of content to this side usually up to 3 buttons.
234
- * The first button should be primary, usually with `fill` and will be visually displayed as the last item,
235
- * but first in the tab order
233
+ * The first button should be primary, usually with `fill`. At larger breakpoints, items will
234
+ * render from right to left, but will collapse vertically and render left to right on smaller mobile screens.
236
235
  */
237
236
  rightSideItems: PropTypes.arrayOf(PropTypes.node.isRequired),
238
237
  /**
@@ -424,6 +423,8 @@ EuiPageHeaderContent.propTypes = {
424
423
  /**
425
424
  * Must be set to true if using `EuiDragDropContext` within a popover,
426
425
  * otherwise your nested drag & drop will have incorrect positioning
426
+ *
427
+ * @deprecated - use `usePortal` prop on children `EuiDraggable` components instead.
427
428
  */
428
429
  hasDragDrop: PropTypes.bool,
429
430
  /**
@@ -10,6 +10,14 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
10
10
  import { css } from '@emotion/react';
11
11
  import { logicalCSS } from '../../../global_styling';
12
12
  var _ref = process.env.NODE_ENV === "production" ? {
13
+ name: "1574q9m-euiPageHeaderContent__top",
14
+ styles: "container-type:inline-size;label:euiPageHeaderContent__top;"
15
+ } : {
16
+ name: "1574q9m-euiPageHeaderContent__top",
17
+ styles: "container-type:inline-size;label:euiPageHeaderContent__top;",
18
+ toString: _EMOTION_STRINGIFIED_CSS_ERROR__
19
+ };
20
+ var _ref2 = process.env.NODE_ENV === "production" ? {
13
21
  name: "1ajq27l-responsiveReverse",
14
22
  styles: "flex-direction:column-reverse;align-items:flex-start;label:responsiveReverse;"
15
23
  } : {
@@ -17,7 +25,7 @@ var _ref = process.env.NODE_ENV === "production" ? {
17
25
  styles: "flex-direction:column-reverse;align-items:flex-start;label:responsiveReverse;",
18
26
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
19
27
  };
20
- var _ref2 = process.env.NODE_ENV === "production" ? {
28
+ var _ref3 = process.env.NODE_ENV === "production" ? {
21
29
  name: "177mkz8-responsive",
22
30
  styles: "flex-direction:column;align-items:flex-start;label:responsive;"
23
31
  } : {
@@ -25,7 +33,7 @@ var _ref2 = process.env.NODE_ENV === "production" ? {
25
33
  styles: "flex-direction:column;align-items:flex-start;label:responsive;",
26
34
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
27
35
  };
28
- var _ref3 = process.env.NODE_ENV === "production" ? {
36
+ var _ref4 = process.env.NODE_ENV === "production" ? {
29
37
  name: "1uwc4oj-stretch",
30
38
  styles: "align-items:stretch;label:stretch;"
31
39
  } : {
@@ -33,7 +41,7 @@ var _ref3 = process.env.NODE_ENV === "production" ? {
33
41
  styles: "align-items:stretch;label:stretch;",
34
42
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
35
43
  };
36
- var _ref4 = process.env.NODE_ENV === "production" ? {
44
+ var _ref5 = process.env.NODE_ENV === "production" ? {
37
45
  name: "8391db-center",
38
46
  styles: "align-items:center;label:center;"
39
47
  } : {
@@ -41,7 +49,7 @@ var _ref4 = process.env.NODE_ENV === "production" ? {
41
49
  styles: "align-items:center;label:center;",
42
50
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
43
51
  };
44
- var _ref5 = process.env.NODE_ENV === "production" ? {
52
+ var _ref6 = process.env.NODE_ENV === "production" ? {
45
53
  name: "1msaet2-bottom",
46
54
  styles: "align-items:flex-end;label:bottom;"
47
55
  } : {
@@ -49,7 +57,7 @@ var _ref5 = process.env.NODE_ENV === "production" ? {
49
57
  styles: "align-items:flex-end;label:bottom;",
50
58
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
51
59
  };
52
- var _ref6 = process.env.NODE_ENV === "production" ? {
60
+ var _ref7 = process.env.NODE_ENV === "production" ? {
53
61
  name: "1gnwbvd-top",
54
62
  styles: "align-items:flex-start;label:top;"
55
63
  } : {
@@ -57,21 +65,25 @@ var _ref6 = process.env.NODE_ENV === "production" ? {
57
65
  styles: "align-items:flex-start;label:top;",
58
66
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
59
67
  };
60
- export var euiPageHeaderContentStyles = function euiPageHeaderContentStyles(_ref7) {
61
- var euiTheme = _ref7.euiTheme;
68
+ export var euiPageHeaderContentStyles = function euiPageHeaderContentStyles(_ref8) {
69
+ var euiTheme = _ref8.euiTheme;
62
70
  return {
63
71
  euiPageHeaderContent: /*#__PURE__*/css(logicalCSS('width', '100%'), " ", logicalCSS('margin-horizontal', 'auto'), ";;label:euiPageHeaderContent;"),
64
72
  // alignItems
65
- top: _ref6,
66
- bottom: _ref5,
67
- center: _ref4,
68
- stretch: _ref3,
73
+ top: _ref7,
74
+ bottom: _ref6,
75
+ center: _ref5,
76
+ stretch: _ref4,
69
77
  // Children only (legacy) expects EuiPageHeaderSections as children
70
- flex: /*#__PURE__*/css("flex-direction:row;display:flex;gap:", euiTheme.size.base, ";justify-content:space-between;;label:flex;"),
71
- // Responsive (what to do at the smaller breakpoint)
72
- responsive: _ref2,
73
- responsiveReverse: _ref,
74
- // Content
78
+ childrenOnly: {
79
+ flex: /*#__PURE__*/css("flex-direction:row;display:flex;gap:", euiTheme.size.base, ";justify-content:space-between;;label:flex;"),
80
+ // Responsive (what to do at the smaller breakpoint)
81
+ responsive: _ref3,
82
+ responsiveReverse: _ref2
83
+ },
84
+ euiPageHeaderContent__top: _ref,
85
+ euiPageHeaderContent__leftSideItems: /*#__PURE__*/css("@container (max-width: ", euiTheme.breakpoint.m, "px){", logicalCSS('min-width', '50%'), ";};label:euiPageHeaderContent__leftSideItems;"),
86
+ euiPageHeaderContent__rightSideItems: /*#__PURE__*/css("flex:0 1 auto;align-content:flex-start;@container (min-width: ", euiTheme.breakpoint.m, "px){", logicalCSS('max-width', '50%'), " justify-content:flex-end;};label:euiPageHeaderContent__rightSideItems;"),
75
87
  euiPageHeaderContent__titleIcon: /*#__PURE__*/css("position:relative;", logicalCSS('top', "-".concat(euiTheme.size.xs)), " ", logicalCSS('margin-right', euiTheme.size.base), ";;label:euiPageHeaderContent__titleIcon;")
76
88
  };
77
89
  };
@@ -663,6 +663,8 @@ EuiPopover.propTypes = {
663
663
  /**
664
664
  * Must be set to true if using `EuiDragDropContext` within a popover,
665
665
  * otherwise your nested drag & drop will have incorrect positioning
666
+ *
667
+ * @deprecated - use `usePortal` prop on children `EuiDraggable` components instead.
666
668
  */
667
669
  hasDragDrop: PropTypes.bool,
668
670
  /**
@@ -17,10 +17,10 @@ import PropTypes from "prop-types";
17
17
  export var COLOR_MODE_MEDIA_QUERY = '(prefers-color-scheme: dark)';
18
18
  export var EuiSystemColorModeProvider = function EuiSystemColorModeProvider(_ref) {
19
19
  var children = _ref.children;
20
- // Use optional chaining here for SSR or test environments
20
+ // Check typeof and use optional chaining for SSR or test environments
21
21
  var _useState = useState(function () {
22
- var _window, _window$matchMedia;
23
- return (_window = window) !== null && _window !== void 0 && (_window$matchMedia = _window.matchMedia) !== null && _window$matchMedia !== void 0 && _window$matchMedia.call(_window, COLOR_MODE_MEDIA_QUERY).matches ? 'DARK' : 'LIGHT';
22
+ var _window$matchMedia, _window;
23
+ return typeof window !== 'undefined' && (_window$matchMedia = (_window = window).matchMedia) !== null && _window$matchMedia !== void 0 && (_window$matchMedia = _window$matchMedia.call(_window, COLOR_MODE_MEDIA_QUERY)) !== null && _window$matchMedia !== void 0 && _window$matchMedia.matches ? 'DARK' : 'LIGHT';
24
24
  }),
25
25
  _useState2 = _slicedToArray(_useState, 2),
26
26
  systemColorMode = _useState2[0],
@@ -10,9 +10,8 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
10
10
  * Side Public License, v 1.
11
11
  */
12
12
 
13
- import React, { useRef } from 'react';
13
+ import React, { useRef, useLayoutEffect } from 'react';
14
14
  import PropTypes from "prop-types";
15
- import { useUpdateEffect } from '../../services';
16
15
  import { useEuiI18n } from '../i18n';
17
16
  import { EuiFieldSearch } from '../form';
18
17
  import { EuiInputPopover } from '../popover';
@@ -24,7 +23,7 @@ export var EuiSearchBox = function EuiSearchBox(_ref) {
24
23
  hint = _ref.hint,
25
24
  rest = _objectWithoutProperties(_ref, _excluded);
26
25
  var _inputRef = useRef(null);
27
- useUpdateEffect(function () {
26
+ useLayoutEffect(function () {
28
27
  if (_inputRef.current) {
29
28
  _inputRef.current.value = query;
30
29
  _inputRef.current.dispatchEvent(new Event('change'));
@@ -260,6 +260,8 @@ EuiTourStep.propTypes = {
260
260
  /**
261
261
  * Must be set to true if using `EuiDragDropContext` within a popover,
262
262
  * otherwise your nested drag & drop will have incorrect positioning
263
+ *
264
+ * @deprecated - use `usePortal` prop on children `EuiDraggable` components instead.
263
265
  */
264
266
  hasDragDrop: PropTypes.bool,
265
267
  /**
package/eui.d.ts CHANGED
@@ -5976,6 +5976,8 @@ declare module '@elastic/eui/src/components/popover/popover' {
5976
5976
  /**
5977
5977
  * Must be set to true if using `EuiDragDropContext` within a popover,
5978
5978
  * otherwise your nested drag & drop will have incorrect positioning
5979
+ *
5980
+ * @deprecated - use `usePortal` prop on children `EuiDraggable` components instead.
5979
5981
  */
5980
5982
  hasDragDrop?: boolean;
5981
5983
  /**
@@ -15730,6 +15732,15 @@ declare module '@elastic/eui/src/components/drag_and_drop/draggable' {
15730
15732
  * Whether the item is currently in a position to be removed
15731
15733
  */
15732
15734
  isRemovable?: boolean;
15735
+ /**
15736
+ * Whether the currently dragged item is cloned into a portal in the body. This settings will
15737
+ * ensure that drag & drop still works as expected within stacking contexts (e.g. within `EuiFlyout`,
15738
+ * `EuiModal` and `EuiPopover`).
15739
+ *
15740
+ * Make sure to apply styles directly to the Draggable content as relative styling from an outside
15741
+ * scope might not be applied when the content is placed in a portal as the DOM structure changes.
15742
+ */
15743
+ usePortal?: boolean;
15733
15744
  /**
15734
15745
  * Adds padding to the draggable item
15735
15746
  */
@@ -20659,9 +20670,14 @@ declare module '@elastic/eui/src/components/page/page_header/page_header_content
20659
20670
  bottom: import("@emotion/utils").SerializedStyles;
20660
20671
  center: import("@emotion/utils").SerializedStyles;
20661
20672
  stretch: import("@emotion/utils").SerializedStyles;
20662
- flex: import("@emotion/utils").SerializedStyles;
20663
- responsive: import("@emotion/utils").SerializedStyles;
20664
- responsiveReverse: import("@emotion/utils").SerializedStyles;
20673
+ childrenOnly: {
20674
+ flex: import("@emotion/utils").SerializedStyles;
20675
+ responsive: import("@emotion/utils").SerializedStyles;
20676
+ responsiveReverse: import("@emotion/utils").SerializedStyles;
20677
+ };
20678
+ euiPageHeaderContent__top: import("@emotion/utils").SerializedStyles;
20679
+ euiPageHeaderContent__leftSideItems: import("@emotion/utils").SerializedStyles;
20680
+ euiPageHeaderContent__rightSideItems: import("@emotion/utils").SerializedStyles;
20665
20681
  euiPageHeaderContent__titleIcon: import("@emotion/utils").SerializedStyles;
20666
20682
  };
20667
20683
 
@@ -20736,7 +20752,8 @@ declare module '@elastic/eui/src/components/page/page_header/page_header_content
20736
20752
  }
20737
20753
  export interface _EuiPageHeaderContentProps extends EuiPageHeaderContentLeft, _EuiPageRestrictWidth {
20738
20754
  /**
20739
- * The only option is on/off
20755
+ * If not set, defaults to true if `tabs` are passed and render at the bottom of the page.
20756
+ * Otherwise, defaults to false.
20740
20757
  */
20741
20758
  bottomBorder?: boolean;
20742
20759
  /**
@@ -20756,8 +20773,8 @@ declare module '@elastic/eui/src/components/page/page_header/page_header_content
20756
20773
  alignItems?: (typeof ALIGN_ITEMS)[number];
20757
20774
  /**
20758
20775
  * Pass custom an array of content to this side usually up to 3 buttons.
20759
- * The first button should be primary, usually with `fill` and will be visually displayed as the last item,
20760
- * but first in the tab order
20776
+ * The first button should be primary, usually with `fill`. At larger breakpoints, items will
20777
+ * render from right to left, but will collapse vertically and render left to right on smaller mobile screens.
20761
20778
  */
20762
20779
  rightSideItems?: ReactNode[];
20763
20780
  /**