@elastic/eui 102.2.0 → 102.3.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 (162) hide show
  1. package/dist/eui_theme_borealis_dark.json +1 -1
  2. package/es/components/badge/color_utils.js +1 -3
  3. package/es/components/badge/notification_badge/badge_notification.styles.js +6 -1
  4. package/es/components/basic_table/basic_table.js +4 -1
  5. package/es/components/basic_table/in_memory_table.js +4 -1
  6. package/es/components/breadcrumbs/_breadcrumb_content.styles.js +6 -3
  7. package/es/components/button/button_display/_button_display.js +1 -1
  8. package/es/components/button/button_display/_button_display.styles.js +11 -2
  9. package/es/components/button/button_display/_button_display_content.styles.js +6 -3
  10. package/es/components/button/button_empty/button_empty.styles.js +9 -12
  11. package/es/components/button/button_group/button_group.styles.js +5 -3
  12. package/es/components/button/button_group/button_group_button.js +19 -9
  13. package/es/components/button/button_group/button_group_button.styles.js +43 -19
  14. package/es/components/button/button_icon/button_icon.js +4 -2
  15. package/es/components/collapsible_nav/collapsible_nav.js +1 -0
  16. package/es/components/datagrid/controls/data_grid_toolbar_control.js +11 -1
  17. package/es/components/datagrid/utils/focus.js +2 -2
  18. package/es/components/filter_group/filter_button.js +88 -23
  19. package/es/components/filter_group/filter_button.styles.js +51 -15
  20. package/es/components/filter_group/filter_group.styles.js +18 -6
  21. package/es/components/markdown_editor/markdown_editor_footer.js +9 -4
  22. package/es/components/search_bar/filters/field_value_selection_filter.js +1 -0
  23. package/es/components/search_bar/filters/field_value_toggle_filter.js +3 -1
  24. package/es/components/search_bar/filters/field_value_toggle_group_filter.js +3 -1
  25. package/es/components/search_bar/filters/is_filter.js +3 -1
  26. package/es/components/search_bar/search_bar.a11y.js +3 -3
  27. package/es/global_styling/mixins/_button.js +95 -28
  28. package/es/services/theme/index.js +2 -1
  29. package/es/services/theme/provider.js +28 -2
  30. package/es/services/theme/theme_variant.js +22 -0
  31. package/es/themes/amsterdam/global_styling/variables/_buttons.js +348 -147
  32. package/es/themes/amsterdam/global_styling/variables/_components.js +229 -224
  33. package/es/themes/amsterdam/theme.js +2 -1
  34. package/es/themes/json/eui_theme_borealis_dark.json +1 -1
  35. package/eui.d.ts +194 -161
  36. package/lib/components/badge/color_utils.js +1 -3
  37. package/lib/components/badge/notification_badge/badge_notification.styles.js +6 -1
  38. package/lib/components/basic_table/basic_table.js +4 -1
  39. package/lib/components/basic_table/in_memory_table.js +4 -1
  40. package/lib/components/breadcrumbs/_breadcrumb_content.styles.js +5 -2
  41. package/lib/components/button/button_display/_button_display.js +1 -1
  42. package/lib/components/button/button_display/_button_display.styles.js +11 -2
  43. package/lib/components/button/button_display/_button_display_content.styles.js +6 -3
  44. package/lib/components/button/button_empty/button_empty.styles.js +10 -11
  45. package/lib/components/button/button_group/button_group.styles.js +5 -3
  46. package/lib/components/button/button_group/button_group_button.js +18 -8
  47. package/lib/components/button/button_group/button_group_button.styles.js +41 -17
  48. package/lib/components/button/button_icon/button_icon.js +3 -1
  49. package/lib/components/collapsible_nav/collapsible_nav.js +1 -0
  50. package/lib/components/datagrid/controls/data_grid_toolbar_control.js +11 -1
  51. package/lib/components/datagrid/utils/focus.js +1 -1
  52. package/lib/components/filter_group/filter_button.js +86 -21
  53. package/lib/components/filter_group/filter_button.styles.js +51 -15
  54. package/lib/components/filter_group/filter_group.styles.js +18 -6
  55. package/lib/components/markdown_editor/markdown_editor_footer.js +8 -3
  56. package/lib/components/search_bar/filters/field_value_selection_filter.js +1 -0
  57. package/lib/components/search_bar/filters/field_value_toggle_filter.js +3 -1
  58. package/lib/components/search_bar/filters/field_value_toggle_group_filter.js +3 -1
  59. package/lib/components/search_bar/filters/is_filter.js +3 -1
  60. package/lib/components/search_bar/search_bar.a11y.js +3 -3
  61. package/lib/global_styling/mixins/_button.js +94 -27
  62. package/lib/services/theme/index.js +42 -1
  63. package/lib/services/theme/provider.js +28 -2
  64. package/lib/services/theme/theme_variant.js +28 -0
  65. package/lib/themes/amsterdam/global_styling/variables/_buttons.js +348 -147
  66. package/lib/themes/amsterdam/global_styling/variables/_components.js +229 -224
  67. package/lib/themes/amsterdam/theme.js +2 -1
  68. package/lib/themes/json/eui_theme_borealis_dark.json +1 -1
  69. package/optimize/es/components/badge/color_utils.js +1 -3
  70. package/optimize/es/components/badge/notification_badge/badge_notification.styles.js +6 -1
  71. package/optimize/es/components/breadcrumbs/_breadcrumb_content.styles.js +6 -3
  72. package/optimize/es/components/button/button_display/_button_display.js +1 -1
  73. package/optimize/es/components/button/button_display/_button_display.styles.js +11 -2
  74. package/optimize/es/components/button/button_display/_button_display_content.styles.js +6 -3
  75. package/optimize/es/components/button/button_empty/button_empty.styles.js +9 -12
  76. package/optimize/es/components/button/button_group/button_group.styles.js +5 -3
  77. package/optimize/es/components/button/button_group/button_group_button.js +12 -8
  78. package/optimize/es/components/button/button_group/button_group_button.styles.js +43 -19
  79. package/optimize/es/components/button/button_icon/button_icon.js +4 -2
  80. package/optimize/es/components/datagrid/controls/data_grid_toolbar_control.js +11 -1
  81. package/optimize/es/components/datagrid/utils/focus.js +2 -2
  82. package/optimize/es/components/filter_group/filter_button.js +78 -21
  83. package/optimize/es/components/filter_group/filter_button.styles.js +51 -15
  84. package/optimize/es/components/filter_group/filter_group.styles.js +18 -6
  85. package/optimize/es/components/markdown_editor/markdown_editor_footer.js +9 -4
  86. package/optimize/es/components/search_bar/filters/field_value_selection_filter.js +1 -0
  87. package/optimize/es/components/search_bar/filters/field_value_toggle_filter.js +3 -1
  88. package/optimize/es/components/search_bar/filters/field_value_toggle_group_filter.js +3 -1
  89. package/optimize/es/components/search_bar/filters/is_filter.js +3 -1
  90. package/optimize/es/components/search_bar/search_bar.a11y.js +3 -3
  91. package/optimize/es/global_styling/mixins/_button.js +95 -28
  92. package/optimize/es/services/theme/index.js +2 -1
  93. package/optimize/es/services/theme/provider.js +28 -2
  94. package/optimize/es/services/theme/theme_variant.js +22 -0
  95. package/optimize/es/themes/amsterdam/global_styling/variables/_buttons.js +348 -147
  96. package/optimize/es/themes/amsterdam/global_styling/variables/_components.js +229 -224
  97. package/optimize/es/themes/amsterdam/theme.js +2 -1
  98. package/optimize/es/themes/json/eui_theme_borealis_dark.json +1 -1
  99. package/optimize/lib/components/badge/color_utils.js +1 -3
  100. package/optimize/lib/components/badge/notification_badge/badge_notification.styles.js +6 -1
  101. package/optimize/lib/components/breadcrumbs/_breadcrumb_content.styles.js +5 -2
  102. package/optimize/lib/components/button/button_display/_button_display.js +1 -1
  103. package/optimize/lib/components/button/button_display/_button_display.styles.js +11 -2
  104. package/optimize/lib/components/button/button_display/_button_display_content.styles.js +6 -3
  105. package/optimize/lib/components/button/button_empty/button_empty.styles.js +10 -11
  106. package/optimize/lib/components/button/button_group/button_group.styles.js +5 -3
  107. package/optimize/lib/components/button/button_group/button_group_button.js +11 -7
  108. package/optimize/lib/components/button/button_group/button_group_button.styles.js +41 -17
  109. package/optimize/lib/components/button/button_icon/button_icon.js +3 -1
  110. package/optimize/lib/components/datagrid/controls/data_grid_toolbar_control.js +11 -1
  111. package/optimize/lib/components/datagrid/utils/focus.js +1 -1
  112. package/optimize/lib/components/filter_group/filter_button.js +76 -19
  113. package/optimize/lib/components/filter_group/filter_button.styles.js +51 -15
  114. package/optimize/lib/components/filter_group/filter_group.styles.js +18 -6
  115. package/optimize/lib/components/markdown_editor/markdown_editor_footer.js +8 -3
  116. package/optimize/lib/components/search_bar/filters/field_value_selection_filter.js +1 -0
  117. package/optimize/lib/components/search_bar/filters/field_value_toggle_filter.js +3 -1
  118. package/optimize/lib/components/search_bar/filters/field_value_toggle_group_filter.js +3 -1
  119. package/optimize/lib/components/search_bar/filters/is_filter.js +3 -1
  120. package/optimize/lib/components/search_bar/search_bar.a11y.js +3 -3
  121. package/optimize/lib/global_styling/mixins/_button.js +94 -27
  122. package/optimize/lib/services/theme/index.js +42 -1
  123. package/optimize/lib/services/theme/provider.js +28 -2
  124. package/optimize/lib/services/theme/theme_variant.js +28 -0
  125. package/optimize/lib/themes/amsterdam/global_styling/variables/_buttons.js +348 -147
  126. package/optimize/lib/themes/amsterdam/global_styling/variables/_components.js +229 -224
  127. package/optimize/lib/themes/amsterdam/theme.js +2 -1
  128. package/optimize/lib/themes/json/eui_theme_borealis_dark.json +1 -1
  129. package/package.json +4 -4
  130. package/test-env/components/badge/color_utils.js +1 -3
  131. package/test-env/components/badge/notification_badge/badge_notification.styles.js +6 -1
  132. package/test-env/components/basic_table/basic_table.js +4 -1
  133. package/test-env/components/basic_table/in_memory_table.js +4 -1
  134. package/test-env/components/breadcrumbs/_breadcrumb_content.styles.js +5 -2
  135. package/test-env/components/button/button_display/_button_display.js +1 -1
  136. package/test-env/components/button/button_display/_button_display.styles.js +11 -2
  137. package/test-env/components/button/button_display/_button_display_content.styles.js +6 -3
  138. package/test-env/components/button/button_empty/button_empty.styles.js +10 -11
  139. package/test-env/components/button/button_group/button_group.styles.js +5 -3
  140. package/test-env/components/button/button_group/button_group_button.js +18 -8
  141. package/test-env/components/button/button_group/button_group_button.styles.js +41 -17
  142. package/test-env/components/button/button_icon/button_icon.js +3 -1
  143. package/test-env/components/collapsible_nav/collapsible_nav.js +1 -0
  144. package/test-env/components/datagrid/controls/data_grid_toolbar_control.js +11 -1
  145. package/test-env/components/datagrid/utils/focus.js +1 -1
  146. package/test-env/components/filter_group/filter_button.js +86 -21
  147. package/test-env/components/filter_group/filter_button.styles.js +51 -15
  148. package/test-env/components/filter_group/filter_group.styles.js +18 -6
  149. package/test-env/components/markdown_editor/markdown_editor_footer.js +8 -3
  150. package/test-env/components/search_bar/filters/field_value_selection_filter.js +1 -0
  151. package/test-env/components/search_bar/filters/field_value_toggle_filter.js +3 -1
  152. package/test-env/components/search_bar/filters/field_value_toggle_group_filter.js +3 -1
  153. package/test-env/components/search_bar/filters/is_filter.js +3 -1
  154. package/test-env/components/search_bar/search_bar.a11y.js +3 -3
  155. package/test-env/global_styling/mixins/_button.js +94 -27
  156. package/test-env/services/theme/index.js +42 -1
  157. package/test-env/services/theme/provider.js +28 -2
  158. package/test-env/services/theme/theme_variant.js +28 -0
  159. package/test-env/themes/amsterdam/global_styling/variables/_buttons.js +348 -147
  160. package/test-env/themes/amsterdam/global_styling/variables/_components.js +229 -224
  161. package/test-env/themes/amsterdam/theme.js +2 -1
  162. package/test-env/themes/json/eui_theme_borealis_dark.json +1 -1
@@ -392,7 +392,7 @@
392
392
  "euiColorBackgroundLightWarning": "#3D3014",
393
393
  "euiColorBackgroundLightRisk": "#4A221C",
394
394
  "euiColorBackgroundLightDanger": "#491D27",
395
- "euiColorBackgroundLightText": "#1D2A3E",
395
+ "euiColorBackgroundLightText": "#2B394F",
396
396
  "euiColorBackgroundFilledPrimary": "#61A2FF",
397
397
  "euiColorBackgroundFilledAccent": "#EE72A6",
398
398
  "euiColorBackgroundFilledAccentSecondary": "#16C5C0",
@@ -35,7 +35,6 @@ export var euiBadgeColors = function euiBadgeColors(euiThemeContext) {
35
35
  risk: euiButtonFillColor(euiThemeContext, 'risk'),
36
36
  danger: euiButtonFillColor(euiThemeContext, 'danger'),
37
37
  accent: euiButtonFillColor(euiThemeContext, 'accent'),
38
- accentSecondary: euiButtonFillColor(euiThemeContext, 'accentSecondary'),
39
38
  disabled: _objectSpread(_objectSpread({}, euiButtonColor(euiThemeContext, 'disabled')), {}, {
40
39
  borderColor: highContrastMode ? euiTheme.colors.textDisabled : ''
41
40
  }),
@@ -53,8 +52,7 @@ export var euiBadgeColors = function euiBadgeColors(euiThemeContext) {
53
52
  }),
54
53
  accentText: _objectSpread(_objectSpread({}, badgeColorsAccentText), {}, {
55
54
  borderColor: highContrastMode ? badgeColorsAccentText.backgroundColor : ''
56
- }),
57
- accentSecondaryText: getBadgeColors(euiThemeContext, euiTheme.colors.textAccentSecondary)
55
+ })
58
56
  };
59
57
  };
60
58
  export var getBadgeColors = function getBadgeColors(euiThemeContext, backgroundColor) {
@@ -9,12 +9,17 @@
9
9
  import { css } from '@emotion/react';
10
10
  import { logicalCSS, euiCanAnimate, euiFontSizeFromScale, euiNumberFormat, mathWithUnits } from '../../../global_styling';
11
11
  import { highContrastModeStyles } from '../../../global_styling/functions/high_contrast';
12
+ import { isEuiThemeRefreshVariant } from '../../../services';
12
13
  import { euiBadgeColors } from '../color_utils';
13
14
  export var euiNotificationBadgeStyles = function euiNotificationBadgeStyles(euiThemeContext) {
14
15
  var euiTheme = euiThemeContext.euiTheme;
16
+ var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'buttonVariant');
15
17
  var badgeColors = euiBadgeColors(euiThemeContext);
18
+ var borderRadius = isRefreshVariant ? mathWithUnits(euiTheme.border.radius.small, function (x) {
19
+ return x / 2;
20
+ }) : euiTheme.border.radius.small;
16
21
  return {
17
- euiNotificationBadge: /*#__PURE__*/css("flex-shrink:0;display:inline-flex;justify-content:center;align-items:center;vertical-align:middle;", logicalCSS('padding-horizontal', euiTheme.size.xs), " border-radius:", euiTheme.border.radius.small, ";", highContrastModeStyles(euiThemeContext, {
22
+ euiNotificationBadge: /*#__PURE__*/css("flex-shrink:0;display:inline-flex;justify-content:center;align-items:center;vertical-align:middle;", logicalCSS('padding-horizontal', euiTheme.size.xs), " border-radius:", borderRadius, ";", highContrastModeStyles(euiThemeContext, {
18
23
  preferred: "\n border: ".concat(euiTheme.border.thin, ";\n overflow: hidden; /* Fix text clipping */\n ")
19
24
  }), " cursor:default;font-size:", euiFontSizeFromScale('xs', euiTheme), ";font-weight:", euiTheme.font.weight.medium, ";", euiNumberFormat(euiThemeContext), " text-align:center;", euiCanAnimate, "{transition:all ", euiTheme.animation.fast, " ease-in;};label:euiNotificationBadge;"),
20
25
  // Sizes
@@ -1191,7 +1191,10 @@ EuiBasicTable.propTypes = {
1191
1191
  render: PropTypes.func
1192
1192
  }),
1193
1193
  /**
1194
- * Describe a custom renderer function for the content
1194
+ * A custom renderer for this column's cell content.
1195
+ * Unlike computed columns or `mobileOptions.render`, this function receives:
1196
+ * - `value`: The value of the specified field for this row
1197
+ * - `item`: The full data item (row object)
1195
1198
  */
1196
1199
  render: PropTypes.func,
1197
1200
  /**
@@ -685,7 +685,10 @@ EuiInMemoryTable.propTypes = {
685
685
  render: PropTypes.func
686
686
  }),
687
687
  /**
688
- * Describe a custom renderer function for the content
688
+ * A custom renderer for this column's cell content.
689
+ * Unlike computed columns or `mobileOptions.render`, this function receives:
690
+ * - `value`: The value of the specified field for this row
691
+ * - `item`: The full data item (row object)
689
692
  */
690
693
  render: PropTypes.func,
691
694
  /**
@@ -7,9 +7,8 @@
7
7
  */
8
8
 
9
9
  import { css } from '@emotion/react';
10
- import { euiFontSize, euiTextTruncate, euiFocusRing, logicalCSS, logicalBorderRadiusCSS, mathWithUnits } from '../../global_styling';
10
+ import { euiFontSize, euiTextTruncate, euiFocusRing, logicalCSS, logicalBorderRadiusCSS, mathWithUnits, euiButtonColor } from '../../global_styling';
11
11
  import { highContrastModeStyles } from '../../global_styling/functions/high_contrast';
12
- import { euiButtonColor } from '../../themes/amsterdam/global_styling/mixins/button';
13
12
 
14
13
  /**
15
14
  * Styles cast to inner <a>, <button>, <span> elements
@@ -19,7 +18,11 @@ export var euiBreadcrumbContentStyles = function euiBreadcrumbContentStyles(euiT
19
18
  highContrastMode = euiThemeContext.highContrastMode;
20
19
 
21
20
  // Reuse button colors for `type="application`" clickable breadcrumbs
22
- var applicationButtonColors = euiButtonColor(euiThemeContext, 'primary');
21
+ var buttonColors = euiButtonColor(euiThemeContext, 'primary');
22
+ var applicationButtonColors = {
23
+ backgroundColor: euiTheme.colors.backgroundLightPrimary,
24
+ color: buttonColors.color
25
+ };
23
26
 
24
27
  // Create custom darker gray colors for non-clickable application breadcrumbs
25
28
  // The numbers/ratios are fairly specific here to pass WCAG AA contrast minimums
@@ -76,7 +76,7 @@ export var EuiButtonDisplay = /*#__PURE__*/forwardRef(function (_ref2, ref) {
76
76
  isLoading: isLoading
77
77
  });
78
78
  var styles = useEuiMemoizedStyles(euiButtonDisplayStyles);
79
- var cssStyles = [styles.euiButtonDisplay, styles[size], fullWidth && styles.fullWidth, minWidth == null && styles.defaultMinWidth, buttonIsDisabled && styles.isDisabled];
79
+ var cssStyles = [styles.euiButtonDisplay, styles[size], fullWidth && styles.fullWidth, minWidth == null && [styles.defaultMinWidth.defaultMinWidth, styles.defaultMinWidth[size]], buttonIsDisabled && styles.isDisabled];
80
80
  var innerNode = ___EmotionJSX(EuiButtonDisplayContent, _extends({
81
81
  isLoading: isLoading,
82
82
  isDisabled: buttonIsDisabled,
@@ -7,6 +7,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
7
7
  * Side Public License, v 1.
8
8
  */
9
9
  import { css } from '@emotion/react';
10
+ import { isEuiThemeRefreshVariant } from '../../../services';
10
11
  import { euiFontSize, logicalCSS, logicalShorthandCSS, logicalTextAlignCSS } from '../../../global_styling';
11
12
  import { euiButtonSizeMap } from '../../../global_styling/mixins';
12
13
  // Provides a solid reset and base for handling sizing layout
@@ -24,18 +25,26 @@ var _ref = process.env.NODE_ENV === "production" ? {
24
25
  };
25
26
  export var euiButtonDisplayStyles = function euiButtonDisplayStyles(euiThemeContext) {
26
27
  var euiTheme = euiThemeContext.euiTheme;
28
+ var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'buttonVariant');
27
29
  var sizes = euiButtonSizeMap(euiThemeContext);
28
30
  var _buttonSize = function _buttonSize(sizeKey) {
29
31
  var size = sizes[sizeKey];
30
32
  return /*#__PURE__*/css(logicalCSS('height', size.height), " line-height:", size.height, ";", euiFontSize(euiThemeContext, size.fontScale), " border-radius:", size.radius, ";");
31
33
  };
34
+ var classicVariantStyles = "\n &:hover:not(:disabled),\n &:focus {\n text-decoration: underline;\n }\n ";
32
35
  return {
33
36
  // Base
34
- euiButtonDisplay: /*#__PURE__*/css(euiButtonBaseCSS(), " font-weight:", euiTheme.font.weight.medium, ";", logicalShorthandCSS('padding', "0 ".concat(euiTheme.size.m)), " &:hover:not(:disabled),&:focus{text-decoration:underline;};label:euiButtonDisplay;"),
37
+ euiButtonDisplay: /*#__PURE__*/css(euiButtonBaseCSS(), " font-weight:", euiTheme.font.weight.medium, ";", logicalShorthandCSS('padding', "0 ".concat(euiTheme.size.m)), " ", !isRefreshVariant && classicVariantStyles, ";;label:euiButtonDisplay;"),
35
38
  // States
36
39
  isDisabled: _ref,
37
40
  fullWidth: /*#__PURE__*/css("display:block;", logicalCSS('width', '100%'), ";;label:fullWidth;"),
38
- defaultMinWidth: /*#__PURE__*/css(logicalCSS('min-width', "".concat(euiTheme.base * 7, "px")), ";;label:defaultMinWidth;"),
41
+ defaultMinWidth: {
42
+ defaultMinWidth: /*#__PURE__*/css(";label:defaultMinWidth;"),
43
+ // Skip css`` for the sizes as we already add classes for sizes and defaultMinWidth
44
+ xs: "\n ".concat(logicalCSS('min-width', "".concat(sizes.xs.minWidth, "px")), "\n "),
45
+ s: "\n ".concat(logicalCSS('min-width', "".concat(sizes.s.minWidth, "px")), "\n "),
46
+ m: "\n ".concat(logicalCSS('min-width', "".concat(sizes.m.minWidth, "px")), "\n ")
47
+ },
39
48
  // Sizes
40
49
  xs: /*#__PURE__*/css(_buttonSize('xs'), ";label:xs;"),
41
50
  s: /*#__PURE__*/css(_buttonSize('s'), ";label:s;"),
@@ -6,11 +6,14 @@
6
6
  * Side Public License, v 1.
7
7
  */
8
8
  import { css } from '@emotion/react';
9
+ import { isEuiThemeRefreshVariant } from '../../../services';
9
10
  import { logicalCSS } from '../../../global_styling';
10
- export var euiButtonDisplayContentStyles = function euiButtonDisplayContentStyles(_ref) {
11
- var euiTheme = _ref.euiTheme;
11
+ export var euiButtonDisplayContentStyles = function euiButtonDisplayContentStyles(euiThemeContext) {
12
+ var euiTheme = euiThemeContext.euiTheme;
13
+ var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'buttonVariant');
14
+ var refreshVariantStyles = "\n /* ensure content stays ontop of hover pseudo element */\n position: relative;\n ";
12
15
  return {
13
16
  // Base
14
- euiButtonDisplayContent: /*#__PURE__*/css(logicalCSS('height', '100%'), " ", logicalCSS('width', '100%'), " display:flex;justify-content:center;align-items:center;vertical-align:middle;gap:", euiTheme.size.s, ";;label:euiButtonDisplayContent;")
17
+ euiButtonDisplayContent: /*#__PURE__*/css(logicalCSS('height', '100%'), " ", logicalCSS('width', '100%'), " display:flex;justify-content:center;align-items:center;vertical-align:middle;gap:", euiTheme.size.s, ";", isRefreshVariant && refreshVariantStyles, ";;label:euiButtonDisplayContent;")
15
18
  };
16
19
  };
@@ -1,4 +1,3 @@
1
- function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
2
1
  /*
3
2
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
4
3
  * or more contributor license agreements. Licensed under the Elastic License
@@ -8,32 +7,30 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
8
7
  */
9
8
 
10
9
  import { css } from '@emotion/react';
11
- import { logicalCSS, logicalShorthandCSS, euiCanAnimate } from '../../../global_styling';
10
+ import { isEuiThemeRefreshVariant } from '../../../services';
11
+ import { logicalCSS, logicalShorthandCSS, euiCanAnimate, highContrastModeStyles } from '../../../global_styling';
12
12
  import { euiButtonDisplayStyles } from '../button_display/_button_display.styles';
13
- var _ref = process.env.NODE_ENV === "production" ? {
14
- name: "1lywbid-flush",
15
- styles: "padding-inline:0;label:flush;"
16
- } : {
17
- name: "1lywbid-flush",
18
- styles: "padding-inline:0;label:flush;",
19
- toString: _EMOTION_STRINGIFIED_CSS_ERROR__
20
- };
21
13
  export var euiButtonEmptyStyles = function euiButtonEmptyStyles(euiThemeContext) {
22
14
  var euiTheme = euiThemeContext.euiTheme;
15
+ var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'buttonVariant');
23
16
 
24
17
  // EuiButtonEmpty uses the same size/font styling as EuiButtonDisplay,
25
18
  // but does not share enough of the same colors/props to the point
26
19
  // of using the actual component - so we'll reuse its styles instead
27
20
  var displayStyles = euiButtonDisplayStyles(euiThemeContext);
21
+ var refreshFlushStyles = "\n /* using duplicate selector to ensure specificity */\n &&:hover,\n &&:active {\n background-color: transparent;\n\n /* removes hover overlay */\n &::before {\n display: none;\n }\n }\n\n &:hover:not(:disabled),\n &:focus {\n text-decoration: underline;\n\n ".concat(highContrastModeStyles(euiThemeContext, {
22
+ forced: "\n /* hides HCM hover border, flush buttons use text-decoration */\n &::after {\n display: none;\n }\n "
23
+ }), "\n }\n ");
28
24
  return {
29
25
  euiButtonEmpty: /*#__PURE__*/css(displayStyles.euiButtonDisplay, " ", logicalShorthandCSS('padding', "0 ".concat(euiTheme.size.s)), euiCanAnimate, "{transition-timing-function:ease-in;transition-duration:", euiTheme.animation.fast, ";};label:euiButtonEmpty;"),
30
26
  isDisabled: displayStyles.isDisabled,
31
27
  // Sizes
32
28
  xs: displayStyles.xs,
33
29
  s: displayStyles.s,
34
- m: displayStyles.m,
30
+ // uses array here to prevent adding duplicate "m" classname partial
31
+ m: [displayStyles.m, isRefreshVariant && "\n ".concat(logicalCSS('padding-horizontal', euiTheme.size.m), "\n ")],
35
32
  // Flush sides
36
- flush: _ref,
33
+ flush: /*#__PURE__*/css("padding-inline:0;", isRefreshVariant && refreshFlushStyles, ";;label:flush;"),
37
34
  left: /*#__PURE__*/css(logicalCSS('margin-right', euiTheme.size.s), ";;label:left;"),
38
35
  right: /*#__PURE__*/css(logicalCSS('margin-left', euiTheme.size.s), ";;label:right;"),
39
36
  both: /*#__PURE__*/css(";label:both;")
@@ -8,6 +8,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
8
8
  */
9
9
 
10
10
  import { css } from '@emotion/react';
11
+ import { isEuiThemeRefreshVariant } from '../../../services';
11
12
  import { logicalCSS } from '../../../global_styling';
12
13
  import { highContrastModeStyles, preventForcedColors } from '../../../global_styling/functions/high_contrast';
13
14
  import { euiFormVariables } from '../../form/form.styles';
@@ -31,7 +32,7 @@ export var euiButtonGroupButtonsStyles = function euiButtonGroupButtonsStyles(eu
31
32
  borderColor = _euiFormVariables.borderColor;
32
33
  return {
33
34
  // Base
34
- euiButtonGroup__buttons: /*#__PURE__*/css(logicalCSS('max-width', '100%'), " display:flex;;label:euiButtonGroup__buttons;"),
35
+ euiButtonGroup__buttons: /*#__PURE__*/css(logicalCSS('max-width', '100%'), " display:flex;align-items:center;;label:euiButtonGroup__buttons;"),
35
36
  fullWidth: /*#__PURE__*/css(logicalCSS('width', '100%'), " .euiButtonGroupButton,.euiButtonGroup__tooltipWrapper{flex:1;", logicalCSS('width', '100%'), ";};label:fullWidth;"),
36
37
  // Sizes
37
38
  m: /*#__PURE__*/css("border-radius:", euiTheme.border.radius.medium, ";", _highContrastStyles(euiThemeContext), ";;label:m;"),
@@ -41,6 +42,7 @@ export var euiButtonGroupButtonsStyles = function euiButtonGroupButtonsStyles(eu
41
42
  };
42
43
  var _highContrastStyles = function _highContrastStyles(euiThemeContext, compressed) {
43
44
  var euiTheme = euiThemeContext.euiTheme;
45
+ var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'buttonVariant');
44
46
 
45
47
  // Account for buttons within tooltip wrappers in selectors
46
48
  var getButtonChildSelectors = function getButtonChildSelectors(selector) {
@@ -50,7 +52,7 @@ var _highContrastStyles = function _highContrastStyles(euiThemeContext, compress
50
52
  preferred: compressed ? "\n .euiButtonGroupButton {\n border: none;\n }\n " : // Conditionally unset the high contrast borders passed by `euiButtonColor` -
51
53
  // faux borders between selected/unselected buttons are rendered by pseudo elements,
52
54
  // and can flip colors depending on selected/unselected siblings
53
- "\n ".concat(getButtonChildSelectors(':not(:first-child, :last-child)'), " {\n ").concat(logicalCSS('border-horizontal', 'none'), "\n }\n ").concat(getButtonChildSelectors(':first-child'), " {\n ").concat(logicalCSS('border-right', 'none'), "\n }\n ").concat(getButtonChildSelectors(':last-child'), " {\n ").concat(logicalCSS('border-left', 'none'), "\n }\n "),
54
- forced: "\n .euiButtonGroupButton-isSelected {\n ".concat(preventForcedColors(euiThemeContext), "\n color: ").concat(euiTheme.colors.emptyShade, ";\n background-color: ").concat(euiTheme.colors.fullShade, ";\n }\n\n .euiButtonGroupButton[disabled] {\n opacity: 0.5;\n }\n ")
55
+ "\n ".concat(!isRefreshVariant && "\n ".concat(getButtonChildSelectors(':not(:first-child, :last-child)'), " {\n ").concat(logicalCSS('border-horizontal', 'none'), "\n }\n ").concat(getButtonChildSelectors(':first-child'), " {\n ").concat(logicalCSS('border-right', 'none'), "\n }\n ").concat(getButtonChildSelectors(':last-child'), " {\n ").concat(logicalCSS('border-left', 'none'), "\n }\n "), "\n "),
56
+ forced: "\n .euiButtonGroupButton-isSelected {\n ".concat(preventForcedColors(euiThemeContext), "\n color: ").concat(euiTheme.colors.emptyShade, ";\n background-color: ").concat(euiTheme.colors.fullShade, ";\n\n ").concat(isRefreshVariant && "\n &:is(:hover, :focus):not(:disabled) {\n &::before {\n border-color: ".concat(euiTheme.colors.textInverse, ";\n }\n }\n "), "\n }\n\n .euiButtonGroupButton[disabled] {\n opacity: 0.5;\n }\n ")
55
57
  });
56
58
  };
@@ -1,11 +1,11 @@
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 = ["className", "id", "isDisabled", "isIconOnly", "isSelected", "label", "value", "size", "color", "toolTipContent", "toolTipProps"];
2
+ var _excluded = ["className", "id", "isDisabled", "isIconOnly", "isSelected", "label", "value", "size", "color", "toolTipContent", "toolTipProps", "contentProps"];
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); }
3
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; }
4
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; }
5
6
  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; }
6
7
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
7
8
  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); }
8
- 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); }
9
9
  function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
10
10
  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."); }
11
11
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
@@ -25,7 +25,7 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
25
25
  import classNames from 'classnames';
26
26
  import PropTypes from "prop-types";
27
27
  import React from 'react';
28
- import { useEuiMemoizedStyles } from '../../../services';
28
+ import { isEuiThemeRefreshVariant, useEuiMemoizedStyles, useEuiTheme } from '../../../services';
29
29
  import { useEuiButtonColorCSS } from '../../../global_styling/mixins/_button';
30
30
  import { useInnerText } from '../../inner_text';
31
31
  import { EuiButtonDisplay } from '../button_display/_button_display';
@@ -46,17 +46,21 @@ export var EuiButtonGroupButton = function EuiButtonGroupButton(_ref) {
46
46
  _color = _ref$color === void 0 ? 'primary' : _ref$color,
47
47
  toolTipContent = _ref.toolTipContent,
48
48
  toolTipProps = _ref.toolTipProps,
49
+ contentProps = _ref.contentProps,
49
50
  rest = _objectWithoutProperties(_ref, _excluded);
51
+ var euiThemeContext = useEuiTheme();
52
+ var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'buttonVariant');
50
53
  var isCompressed = size === 'compressed';
51
54
  var color = isDisabled ? 'disabled' : _color;
52
- var display = isSelected ? 'fill' : isCompressed ? 'empty' : 'base';
55
+ var hasBorder = isRefreshVariant && color !== 'text' && !isCompressed;
56
+ var display = isSelected ? 'fill' : isCompressed || hasBorder ? 'empty' : 'base';
53
57
  var hasToolTip = !!toolTipContent;
54
58
  var styles = useEuiMemoizedStyles(euiButtonGroupButtonStyles);
55
59
  var focusColorStyles = useEuiMemoizedStyles(_compressedButtonFocusColors);
56
60
  var buttonColorStyles = useEuiButtonColorCSS({
57
61
  display: display
58
62
  })[color];
59
- var cssStyles = [styles.euiButtonGroupButton, isIconOnly && styles.iconOnly, !isCompressed && (hasToolTip ? styles.uncompressed.hasToolTip : styles.uncompressed[size]), isCompressed ? styles.compressed : styles.uncompressed.uncompressed, isDisabled && isSelected ? styles.disabledAndSelected : buttonColorStyles, !isDisabled && isCompressed && focusColorStyles[color]];
63
+ var cssStyles = [styles.euiButtonGroupButton, isIconOnly && styles.iconOnly, !isCompressed && (hasToolTip ? styles.uncompressed.hasToolTip : styles.uncompressed[size]), isCompressed ? styles.compressed : styles.uncompressed.uncompressed, isDisabled && isSelected ? styles.disabledAndSelected : buttonColorStyles, !isDisabled && isCompressed && focusColorStyles[color], hasBorder && styles.hasBorder];
60
64
  var tooltipWrapperStyles = [styles.tooltipWrapper, !isCompressed && styles.uncompressed[size]];
61
65
  var contentStyles = [styles.content.euiButtonGroupButton__content, isCompressed && styles.content.compressed];
62
66
  var textStyles = [isIconOnly ? styles.text.euiButtonGroupButton__iconOnly : styles.text.euiButtonGroupButton__text];
@@ -84,9 +88,9 @@ export var EuiButtonGroupButton = function EuiButtonGroupButton(_ref) {
84
88
  className: buttonClasses,
85
89
  isDisabled: isDisabled,
86
90
  size: size === 'compressed' ? 's' : size,
87
- contentProps: {
88
- css: contentStyles
89
- },
91
+ contentProps: _objectSpread(_objectSpread({}, contentProps), {}, {
92
+ css: [contentStyles, contentProps === null || contentProps === void 0 ? void 0 : contentProps.css]
93
+ }),
90
94
  textProps: {
91
95
  css: textStyles,
92
96
  ref: buttonTextRef,
@@ -175,7 +179,13 @@ EuiButtonGroupButton.propTypes = {
175
179
  /**
176
180
  * Inherit from EuiButtonGroup
177
181
  */
178
- onClick: PropTypes.func.isRequired
182
+ onClick: PropTypes.func.isRequired,
183
+ contentProps: PropTypes.shape({
184
+ className: PropTypes.string,
185
+ "aria-label": PropTypes.string,
186
+ "data-test-subj": PropTypes.string,
187
+ css: PropTypes.any
188
+ })
179
189
  };
180
190
  var EuiButtonGroupButtonWithToolTip = function EuiButtonGroupButtonWithToolTip(_ref2) {
181
191
  var _toolTipProps$anchorP, _toolTipProps$anchorP2;
@@ -20,17 +20,17 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
20
20
  */
21
21
 
22
22
  import { css } from '@emotion/react';
23
- import { makeDisabledContrastColor } from '../../../services';
24
- import { mathWithUnits, logicalCSS, logicalShorthandCSS, euiTextShift, euiOutline, euiCanAnimate } from '../../../global_styling';
23
+ import { isEuiThemeRefreshVariant, makeDisabledContrastColor } from '../../../services';
24
+ import { mathWithUnits, logicalCSS, logicalShorthandCSS, euiTextShift, euiOutline, euiCanAnimate, preventForcedColors, highContrastModeStyles } from '../../../global_styling';
25
25
  import { euiButtonFillColor, BUTTON_COLORS } from '../../../global_styling/mixins/_button';
26
26
  import { euiScreenReaderOnly } from '../../accessibility';
27
27
  import { euiFormVariables } from '../../form/form.styles';
28
28
  var _ref = process.env.NODE_ENV === "production" ? {
29
- name: "nwv4a2-tooltipWrapper",
30
- styles: "overflow:hidden;label:tooltipWrapper;"
29
+ name: "m6ysua-tooltipWrapper",
30
+ styles: "overflow:hidden;&:has(:focus-visible){z-index:1;};label:tooltipWrapper;"
31
31
  } : {
32
- name: "nwv4a2-tooltipWrapper",
33
- styles: "overflow:hidden;label:tooltipWrapper;",
32
+ name: "m6ysua-tooltipWrapper",
33
+ styles: "overflow:hidden;&:has(:focus-visible){z-index:1;};label:tooltipWrapper;",
34
34
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
35
35
  };
36
36
  var _ref2 = process.env.NODE_ENV === "production" ? {
@@ -44,48 +44,70 @@ var _ref2 = process.env.NODE_ENV === "production" ? {
44
44
  export var euiButtonGroupButtonStyles = function euiButtonGroupButtonStyles(euiThemeContext) {
45
45
  var euiTheme = euiThemeContext.euiTheme,
46
46
  highContrastMode = euiThemeContext.highContrastMode;
47
+ var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'buttonVariant');
47
48
  var _euiFormVariables = euiFormVariables(euiThemeContext),
48
49
  controlCompressedHeight = _euiFormVariables.controlCompressedHeight,
49
50
  controlCompressedBorderRadius = _euiFormVariables.controlCompressedBorderRadius;
50
51
  var compressedButtonHeight = mathWithUnits([controlCompressedHeight, euiTheme.border.width.thin], function (x, y) {
51
- return x - y * 2;
52
+ return isRefreshVariant ? x - y * 6 : x - y * 2;
52
53
  });
54
+ var selectedSelectors = '.euiButtonGroupButton-isSelected, .euiButtonGroup__tooltipWrapper-isSelected';
53
55
  var uncompressedBorderRadii = function uncompressedBorderRadii(radiusSize) {
54
- return "\n border-radius: 0;\n\n &:first-child {\n ".concat(logicalShorthandCSS('border-radius', "".concat(radiusSize, " 0 0 ").concat(radiusSize)), "\n }\n\n &:last-child {\n ").concat(logicalShorthandCSS('border-radius', "0 ".concat(radiusSize, " ").concat(radiusSize, " 0")), "\n }\n ");
56
+ return "\n border-radius: 0;\n\n &:first-child {\n ".concat(logicalShorthandCSS('border-radius', "".concat(radiusSize, " 0 0 ").concat(radiusSize)), "\n }\n\n &:last-child {\n ").concat(logicalShorthandCSS('border-radius', "0 ".concat(radiusSize, " ").concat(radiusSize, " 0")), "\n }\n\n &:first-child:last-child {\n ").concat(logicalShorthandCSS('border-radius', "".concat(radiusSize)), "\n }\n ");
55
57
  };
58
+ var refreshVariantStyles = "\n &:is(".concat(selectedSelectors, ") {\n ").concat(highContrastModeStyles(euiThemeContext, {
59
+ forced: "\n --highContrastHoverIndicatorColor: ".concat(euiTheme.colors.textInverse, ";\n border: none;\n\n /* styles the content manually instead of the button itself to preserve the system\n focus style, as otherwise preventForcedColors() would require manual styling */\n > [class*=\"euiButtonDisplayContent\"] {\n ").concat(preventForcedColors(euiThemeContext), "\n color: ").concat(euiTheme.colors.emptyShade, ";\n border: none;\n }\n ")
60
+ }), "\n }\n ");
61
+ var uncompressedStyles = isRefreshVariant ? "\n &:is(".concat(selectedSelectors, "):not(:disabled) {\n z-index: 1;\n /* prevent layout jumps due to missing border for selected/filled buttons */\n border: ").concat(euiTheme.border.width.thin, " solid transparent;\n\n ").concat(highContrastModeStyles(euiThemeContext, {
62
+ forced: "\n /* use inset focus outline to ensure visibility, same as custom hover.\n NOTE: temp solution - this will be revisited once we handle global focus styles */\n &:focus-visible {\n outline-color: ".concat(euiTheme.colors.textInverse, ";\n /* has to be inset due to overflow: hidden */\n outline-offset: -").concat(mathWithUnits(euiTheme.border.width.thin, function (x) {
63
+ return x * 4;
64
+ }), ";\n }\n ")
65
+ }), "\n }\n ") : "\n &:is(.euiButtonGroupButton-isSelected) {\n font-weight: ".concat(euiTheme.font.weight.bold, ";\n }\n ");
66
+ var compressedStyles = isRefreshVariant ? "\n margin: ".concat(euiTheme.size.xxs, ";\n border-radius: ").concat(mathWithUnits(euiTheme.border.radius.small, function (x) {
67
+ return x / 2;
68
+ }), ";\n\n & + .euiButtonGroupButton {\n ").concat(logicalCSS('margin-left', '0'), "\n }\n\n &:is(").concat(selectedSelectors, "):not(:disabled) {\n /* prevent layout jumps due to missing border for non-selected buttons */\n border: none;\n\n ").concat(highContrastModeStyles(euiThemeContext, {
69
+ forced: "\n /* use inset focus outline to ensure visibility, same as custom hover.\n NOTE: temp solution - this will be revisited once we handle global focus styles */\n &:focus-visible {\n outline-color: ".concat(euiTheme.colors.textInverse, ";\n /* has to be inset due to overflow: hidden */\n outline-offset: -").concat(mathWithUnits(euiTheme.border.width.thin, function (x) {
70
+ return x * 3;
71
+ }), ";\n }\n ")
72
+ }), "\n }\n ") : "\n background-clip: content-box;\n /* Tweak border radius to account for the padding & background-clip */\n border-radius: ".concat(mathWithUnits([controlCompressedBorderRadius, euiTheme.border.width.thin], function (x, y) {
73
+ return x + y;
74
+ }), ";\n\n &:is(.euiButtonGroupButton-isSelected) {\n font-weight: ").concat(euiTheme.font.weight.semiBold, ";\n }\n ");
56
75
  return {
57
76
  // Base
58
- euiButtonGroupButton: /*#__PURE__*/css(logicalCSS('min-width', 0), " flex-shrink:1;flex-grow:0;z-index:0;&:focus-visible{z-index:1;}", euiCanAnimate, "{transition:background-color ", euiTheme.animation.normal, " ease-in-out,color ", euiTheme.animation.normal, " ease-in-out;};label:euiButtonGroupButton;"),
77
+ euiButtonGroupButton: /*#__PURE__*/css(logicalCSS('min-width', 0), " flex-shrink:1;flex-grow:0;z-index:0;&:focus-visible{z-index:2;}", euiCanAnimate, "{transition:background-color ", euiTheme.animation.normal, " ease-in-out,color ", euiTheme.animation.normal, " ease-in-out;}", isRefreshVariant && refreshVariantStyles, ";;label:euiButtonGroupButton;"),
59
78
  iconOnly: /*#__PURE__*/css("padding-inline:", euiTheme.size.s, ";;label:iconOnly;"),
60
79
  // Sizes
61
80
  uncompressed: {
62
- uncompressed: /*#__PURE__*/css("&:is(.euiButtonGroupButton-isSelected){font-weight:", euiTheme.font.weight.bold, ";}&:focus-visible{", euiOutline(euiThemeContext, 'inset', euiTheme.components.buttonGroupFocusColor), ";};label:uncompressed;"),
81
+ uncompressed: /*#__PURE__*/css("&:focus-visible{", euiOutline(euiThemeContext, 'inset', euiTheme.components.buttonGroupFocusColor), ";}", uncompressedStyles, ";;label:uncompressed;"),
63
82
  get borders() {
64
83
  // We use pseudo elements to avoid affecing button width, and to allow
65
84
  // inheriting high contrast border colors
66
- var selectors = '.euiButtonGroupButton-isSelected, .euiButtonGroup__tooltipWrapper-isSelected';
85
+ var selectors = selectedSelectors;
67
86
  var selectedColor = highContrastMode ? euiTheme.colors.emptyShade : euiTheme.components.buttonGroupBorderColorSelected;
68
87
  var unselectedColor = highContrastMode ? 'inherit' : euiTheme.components.buttonGroupBorderColor;
88
+ var borderWidth = euiTheme.border.width.thin;
89
+ var borderStyles = isRefreshVariant ? "\n &:not(:first-child) {\n margin-inline-start: -".concat(borderWidth, ";\n }\n\n &:is(").concat(selectors, ") {\n &::before {\n position: absolute;\n z-index: 1;\n ").concat(logicalCSS('left', 0), "\n ").concat(logicalCSS('vertical', "-".concat(euiTheme.border.width.thin)), "\n ").concat(logicalCSS('border-left-style', 'solid'), "\n ").concat(logicalCSS('border-left-width', euiTheme.border.width.thin), "\n pointer-events: none;\n\n ").concat(preventForcedColors(euiThemeContext), "\n }\n }\n ") : "\n &::before {\n position: absolute;\n ".concat(logicalCSS('left', 0), "\n ").concat(logicalCSS('vertical', highContrastMode ? "-".concat(euiTheme.border.width.thin) : 0), "\n ").concat(logicalCSS('border-left-style', 'solid'), "\n ").concat(logicalCSS('border-left-width', euiTheme.border.width.thin), "\n pointer-events: none;\n }\n ");
69
90
 
70
91
  // "Borders" between buttons should be present between two of the same colored buttons,
71
92
  // and absent between selected vs non-selected buttons (different colors)
72
- return "\n position: relative;\n\n &::before {\n position: absolute;\n ".concat(logicalCSS('left', 0), "\n ").concat(logicalCSS('vertical', highContrastMode ? "-".concat(euiTheme.border.width.thin) : 0), "\n ").concat(logicalCSS('border-left-style', 'solid'), "\n ").concat(logicalCSS('border-left-width', euiTheme.border.width.thin), "\n pointer-events: none;\n }\n \n &:not(").concat(selectors, ") + *:not(").concat(selectors, ") {\n &::before {\n content: '';\n border-color: ").concat(unselectedColor, ";\n }\n }\n\n &:is(").concat(selectors, ") + *:is(").concat(selectors, ") {\n &::before {\n content: '';\n border-color: ").concat(selectedColor, ";\n }\n }\n ");
93
+ return "\n position: relative;\n\n ".concat(borderStyles, "\n\n &:not(").concat(selectors, ") + *:not(").concat(selectors, ") {\n &::before {\n content: '';\n border-color: ").concat(unselectedColor, ";\n }\n }\n\n &:is(").concat(selectors, ") + *:is(").concat(selectors, ") {\n &::before {\n content: '';\n border-color: ").concat(selectedColor, ";\n }\n }\n ");
73
94
  },
74
95
  get s() {
75
96
  return /*#__PURE__*/css(this.borders, " ", uncompressedBorderRadii(euiTheme.border.radius.small), ";;label:s;");
76
97
  },
77
98
  get m() {
78
- return /*#__PURE__*/css(this.borders, " ", uncompressedBorderRadii(euiTheme.border.radius.medium), ";;label:m;");
99
+ var radius = isRefreshVariant ? euiTheme.border.radius.small : euiTheme.border.radius.medium;
100
+ return /*#__PURE__*/css(this.borders, " ", uncompressedBorderRadii(radius), ";;label:m;");
79
101
  },
80
102
  hasToolTip: _ref2
81
103
  },
82
- compressed: /*#__PURE__*/css(logicalCSS('height', compressedButtonHeight), " line-height:", compressedButtonHeight, ";padding:", mathWithUnits(euiTheme.border.width.thin, function (x) {
104
+ compressed: /*#__PURE__*/css(logicalCSS('height', compressedButtonHeight), " line-height:", compressedButtonHeight, ";font-weight:", euiTheme.font.weight.regular, ";padding:", isRefreshVariant ? '0' : mathWithUnits(euiTheme.border.width.thin, function (x) {
83
105
  return x * 2;
84
- }), ";background-clip:content-box;border-radius:", mathWithUnits([controlCompressedBorderRadius, euiTheme.border.width.thin], function (x, y) {
85
- return x + y;
86
- }), ";font-weight:", euiTheme.font.weight.regular, ";&:is(.euiButtonGroupButton-isSelected){font-weight:", euiTheme.font.weight.semiBold, ";};label:compressed;"),
106
+ }), ";", compressedStyles, ";;label:compressed;"),
87
107
  // States
88
- disabledAndSelected: /*#__PURE__*/css("color:", makeDisabledContrastColor(euiTheme.colors.textDisabled)(euiTheme.components.buttonGroupBackgroundDisabledSelected), ";background-color:", euiTheme.components.buttonGroupBackgroundDisabledSelected, ";border:", highContrastMode && "".concat(euiTheme.border.width.thin, " solid ").concat(euiTheme.components.buttonGroupBackgroundDisabledSelected), ";;label:disabledAndSelected;"),
108
+ disabledAndSelected: /*#__PURE__*/css("color:", isRefreshVariant ? euiTheme.colors.textDisabled : makeDisabledContrastColor(euiTheme.colors.textDisabled)(euiTheme.components.buttonGroupBackgroundDisabledSelected), ";background-color:", euiTheme.components.buttonGroupBackgroundDisabledSelected, ";border:", highContrastMode ? "".concat(euiTheme.border.width.thin, " solid ").concat(euiTheme.components.buttonGroupBackgroundDisabledSelected) : isRefreshVariant ? "".concat(euiTheme.border.width.thin, " solid ").concat(euiTheme.colors.borderBasePlain) : '', ";;label:disabledAndSelected;"),
109
+ // Skip css`` to avoid generating a className
110
+ hasBorder: "\n border: ".concat(euiTheme.border.width.thin, " solid\n ").concat(euiTheme.colors.borderBasePlain, ";\n "),
89
111
  // Tooltip anchor wrapper
90
112
  tooltipWrapper: _ref,
91
113
  // Content wrapper
@@ -101,10 +123,12 @@ export var euiButtonGroupButtonStyles = function euiButtonGroupButtonStyles(euiT
101
123
  };
102
124
  };
103
125
  export var _compressedButtonFocusColors = function _compressedButtonFocusColors(euiThemeContext) {
126
+ var euiTheme = euiThemeContext.euiTheme;
127
+ var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'buttonVariant');
104
128
  var colors = [].concat(_toConsumableArray(BUTTON_COLORS), ['disabled']);
105
129
  return colors.reduce(function (acc, color) {
106
130
  var _euiButtonFillColor = euiButtonFillColor(euiThemeContext, color),
107
131
  backgroundColor = _euiButtonFillColor.backgroundColor;
108
- return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, color, /*#__PURE__*/css("&:focus-visible{", euiOutline(euiThemeContext, 'center', backgroundColor), " &:is(.euiButtonGroupButton-isSelected){outline-offset:0;}}")));
132
+ return _objectSpread(_objectSpread({}, acc), {}, _defineProperty({}, color, /*#__PURE__*/css("&:focus-visible{", euiOutline(euiThemeContext, isRefreshVariant ? 'outset' : 'center', isRefreshVariant ? euiTheme.focus.color : backgroundColor), " ", !isRefreshVariant && "\n &:is(.euiButtonGroupButton-isSelected) {\n outline-offset: 0;\n }\n ", ";}")));
109
133
  }, {});
110
134
  };
@@ -13,7 +13,7 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
13
13
  import React from 'react';
14
14
  import PropTypes from "prop-types";
15
15
  import classNames from 'classnames';
16
- import { getSecureRelForTarget, useEuiMemoizedStyles } from '../../../services';
16
+ import { getSecureRelForTarget, isEuiThemeRefreshVariant, useEuiMemoizedStyles, useEuiTheme } from '../../../services';
17
17
  import { EuiIcon } from '../../icon';
18
18
  import { EuiLoadingSpinner } from '../../loading';
19
19
  import { useEuiButtonColorCSS, useEuiButtonFocusCSS } from '../../../global_styling/mixins/_button';
@@ -44,6 +44,8 @@ export var EuiButtonIcon = function EuiButtonIcon(_ref) {
44
44
  isSelected = _ref.isSelected,
45
45
  isLoading = _ref.isLoading,
46
46
  rest = _objectWithoutProperties(_ref, _excluded);
47
+ var euiThemeContext = useEuiTheme();
48
+ var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'buttonVariant');
47
49
  var isDisabled = isButtonDisabled({
48
50
  isDisabled: _isDisabled || disabled,
49
51
  href: href,
@@ -60,7 +62,7 @@ export var EuiButtonIcon = function EuiButtonIcon(_ref) {
60
62
  var buttonFocusStyle = useEuiButtonFocusCSS();
61
63
  var emptyHoverStyles = useEuiMemoizedStyles(_emptyHoverStyles);
62
64
  var styles = useEuiMemoizedStyles(euiButtonIconStyles);
63
- var cssStyles = [styles.euiButtonIcon, styles[size], buttonColorStyles[isDisabled ? 'disabled' : color], buttonFocusStyle, display === 'empty' && !isDisabled && emptyHoverStyles[color], isDisabled && styles.isDisabled];
65
+ var cssStyles = [styles.euiButtonIcon, styles[size], buttonColorStyles[isDisabled ? 'disabled' : color], buttonFocusStyle, !isRefreshVariant && display === 'empty' && !isDisabled && emptyHoverStyles[color], isDisabled && styles.isDisabled];
64
66
  var classes = classNames('euiButtonIcon', className);
65
67
 
66
68
  // Add an icon to the button if one exists.
@@ -207,6 +207,7 @@ EuiCollapsibleNav.propTypes = {
207
207
  * Object of props passed to EuiFocusTrap.
208
208
  * `shards` specifies an array of elements that will be considered part of the flyout, preventing the flyout from being closed when clicked.
209
209
  * `closeOnMouseup` will delay the close callback, allowing time for external toggle buttons to handle close behavior.
210
+ * `returnFocus` defines the return focus behavior and provides the possibility to check the available target element or opt out of the behavior in favor of manually returning focus
210
211
  */
211
212
  focusTrapProps: PropTypes.any,
212
213
  /**
@@ -15,6 +15,7 @@ import PropTypes from "prop-types";
15
15
  import React from 'react';
16
16
  import classNames from 'classnames';
17
17
  import { css } from '@emotion/react';
18
+ import { useEuiTheme, useEuiThemeRefreshVariant } from '../../../services';
18
19
  import { EuiButtonEmpty } from '../../button';
19
20
  import { EuiNotificationBadge } from '../../badge';
20
21
  import { useEuiI18n } from '../../i18n';
@@ -25,7 +26,12 @@ export var EuiDataGridToolbarControl = function EuiDataGridToolbarControl(_ref)
25
26
  badgeContent = _ref.badgeContent,
26
27
  textProps = _ref.textProps,
27
28
  rest = _objectWithoutProperties(_ref, _excluded);
29
+ var euiThemeContext = useEuiTheme();
30
+ var isRefreshVariant = useEuiThemeRefreshVariant('buttonVariant');
28
31
  var classes = classNames('euiDataGridToolbarControl', className);
32
+ var cssStyles = isRefreshVariant ?
33
+ // passes euiThemeContext here instead via `css` to ensure legacy Enzyme tests work
34
+ interactiveStyles(euiThemeContext) : underlineStyles;
29
35
  var badgeAriaLabel = useEuiI18n('euiDataGridToolbarControl.badgeAriaLabel', 'Active: {count}', {
30
36
  count: typeof badgeContent === 'string' ? betterScreenReaderSlashes(badgeContent) : badgeContent
31
37
  });
@@ -34,7 +40,7 @@ export var EuiDataGridToolbarControl = function EuiDataGridToolbarControl(_ref)
34
40
  size: "xs",
35
41
  color: "text",
36
42
  textProps: false,
37
- css: underlineStyles
43
+ css: cssStyles
38
44
  }, rest), ___EmotionJSX("span", _extends({}, textProps, {
39
45
  className: classNames('euiDataGridToolbarControl__text', 'eui-textTruncate', textProps && textProps.className)
40
46
  }), children), Boolean(badgeContent) && ___EmotionJSX(EuiNotificationBadge, {
@@ -151,6 +157,10 @@ var underlineStyles = process.env.NODE_ENV === "production" ? {
151
157
  styles: "&:focus,&:hover:not(:disabled){text-decoration:none;.euiDataGridToolbarControl__text{text-decoration:underline;}};label:underlineStyles;",
152
158
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
153
159
  };
160
+ var interactiveStyles = function interactiveStyles(_ref2) {
161
+ var euiTheme = _ref2.euiTheme;
162
+ return /*#__PURE__*/css("&:focus,&:hover:not(:disabled){.euiDataGridToolbarControl__badge{background-color:", euiTheme.components.filterButtonBadgeBackgroundHover, ";}};label:interactiveStyles;");
163
+ };
154
164
  var badgeStyles = process.env.NODE_ENV === "production" ? {
155
165
  name: "1968nw3-badgeStyles",
156
166
  styles: "cursor:inherit;label:badgeStyles;"
@@ -12,7 +12,7 @@ function _arrayWithHoles(r) { if (Array.isArray(r)) return r; }
12
12
  * Side Public License, v 1.
13
13
  */
14
14
 
15
- import { createContext, useCallback, useEffect, useMemo, useRef, useState } from 'react';
15
+ import { createContext, useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react';
16
16
  import { tabbable } from 'tabbable';
17
17
  import { keys } from '../../../services';
18
18
  export var DataGridFocusContext = /*#__PURE__*/createContext({
@@ -60,7 +60,7 @@ export var useFocus = function useFocus() {
60
60
  });
61
61
  }, []);
62
62
  var previousCell = useRef(undefined);
63
- useEffect(function () {
63
+ useLayoutEffect(function () {
64
64
  if (previousCell.current) {
65
65
  notifyCellOfFocusState(cellsUpdateFocus.current, previousCell.current, false);
66
66
  }