@elastic/eui 102.0.0 → 102.1.0-snapshot.1746441787383

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 (258) hide show
  1. package/dist/eui_theme_borealis_dark.json +1 -1
  2. package/es/components/accessibility/skip_link/skip_link.js +7 -0
  3. package/es/components/badge/color_utils.js +1 -3
  4. package/es/components/badge/notification_badge/badge_notification.styles.js +6 -1
  5. package/es/components/breadcrumbs/_breadcrumb_content.styles.js +6 -3
  6. package/es/components/button/button.js +7 -0
  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.js +7 -0
  11. package/es/components/button/button_empty/button_empty.styles.js +9 -12
  12. package/es/components/button/button_group/button_group.js +5 -0
  13. package/es/components/button/button_group/button_group.styles.js +5 -3
  14. package/es/components/button/button_group/button_group_button.js +19 -9
  15. package/es/components/button/button_group/button_group_button.styles.js +43 -19
  16. package/es/components/button/button_icon/button_icon.js +11 -2
  17. package/es/components/card/card.js +7 -0
  18. package/es/components/card/card_select/card_select.js +7 -0
  19. package/es/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +7 -0
  20. package/es/components/color_picker/color_picker.js +13 -8
  21. package/es/components/color_picker/hue.js +27 -6
  22. package/es/components/color_picker/hue.styles.js +3 -2
  23. package/es/components/color_picker/saturation.js +16 -11
  24. package/es/components/color_picker/saturation.styles.js +2 -1
  25. package/es/components/datagrid/body/cell/data_grid_cell.js +7 -0
  26. package/es/components/datagrid/body/cell/data_grid_cell_actions.js +2 -2
  27. package/es/components/datagrid/body/cell/data_grid_cell_actions.styles.js +1 -1
  28. package/es/components/datagrid/body/data_grid_body.js +7 -0
  29. package/es/components/datagrid/body/data_grid_body_custom.js +7 -0
  30. package/es/components/datagrid/body/data_grid_body_virtualized.js +7 -0
  31. package/es/components/datagrid/body/header/data_grid_header_cell.js +7 -0
  32. package/es/components/datagrid/controls/column_sorting.js +7 -0
  33. package/es/components/datagrid/controls/data_grid_toolbar_control.js +18 -1
  34. package/es/components/datagrid/utils/in_memory.js +7 -0
  35. package/es/components/date_picker/auto_refresh/auto_refresh.js +7 -0
  36. package/es/components/filter_group/filter_button.js +98 -24
  37. package/es/components/filter_group/filter_button.styles.js +51 -15
  38. package/es/components/filter_group/filter_group.styles.js +18 -6
  39. package/es/components/header/header_links/header_link.js +7 -0
  40. package/es/components/header/header_section/header_section_item_button.js +7 -0
  41. package/es/components/list_group/list_group.js +7 -0
  42. package/es/components/list_group/list_group_item.js +7 -0
  43. package/es/components/list_group/list_group_item_extra_action.js +7 -0
  44. package/es/components/list_group/pinnable_list_group/pinnable_list_group.js +7 -0
  45. package/es/components/pagination/pagination_button.js +7 -0
  46. package/es/components/search_bar/filters/field_value_selection_filter.js +1 -0
  47. package/es/components/search_bar/filters/field_value_toggle_filter.js +3 -1
  48. package/es/components/search_bar/filters/field_value_toggle_group_filter.js +3 -1
  49. package/es/components/search_bar/filters/is_filter.js +3 -1
  50. package/es/components/search_bar/search_bar.a11y.js +3 -3
  51. package/es/components/table/table_header_cell.js +30 -12
  52. package/es/components/tool_tip/tool_tip.js +4 -1
  53. package/es/global_styling/mixins/_button.js +108 -31
  54. package/es/global_styling/mixins/_color.js +9 -2
  55. package/es/services/theme/index.js +2 -1
  56. package/es/services/theme/provider.js +28 -2
  57. package/es/services/theme/theme_variant.js +22 -0
  58. package/es/test/index.d.ts +2 -1
  59. package/es/themes/amsterdam/global_styling/variables/_buttons.js +348 -147
  60. package/es/themes/amsterdam/global_styling/variables/_components.js +229 -224
  61. package/es/themes/amsterdam/theme.js +2 -1
  62. package/eui.d.ts +919 -701
  63. package/lib/components/accessibility/skip_link/skip_link.js +7 -0
  64. package/lib/components/badge/color_utils.js +1 -3
  65. package/lib/components/badge/notification_badge/badge_notification.styles.js +6 -1
  66. package/lib/components/breadcrumbs/_breadcrumb_content.styles.js +5 -2
  67. package/lib/components/button/button.js +7 -0
  68. package/lib/components/button/button_display/_button_display.js +1 -1
  69. package/lib/components/button/button_display/_button_display.styles.js +11 -2
  70. package/lib/components/button/button_display/_button_display_content.styles.js +6 -3
  71. package/lib/components/button/button_empty/button_empty.js +7 -0
  72. package/lib/components/button/button_empty/button_empty.styles.js +10 -11
  73. package/lib/components/button/button_group/button_group.js +5 -0
  74. package/lib/components/button/button_group/button_group.styles.js +5 -3
  75. package/lib/components/button/button_group/button_group_button.js +18 -8
  76. package/lib/components/button/button_group/button_group_button.styles.js +41 -17
  77. package/lib/components/button/button_icon/button_icon.js +10 -1
  78. package/lib/components/card/card.js +7 -0
  79. package/lib/components/card/card_select/card_select.js +7 -0
  80. package/lib/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +7 -0
  81. package/lib/components/color_picker/color_picker.js +13 -8
  82. package/lib/components/color_picker/hue.js +26 -5
  83. package/lib/components/color_picker/hue.styles.js +3 -2
  84. package/lib/components/color_picker/saturation.js +16 -11
  85. package/lib/components/color_picker/saturation.styles.js +2 -1
  86. package/lib/components/datagrid/body/cell/data_grid_cell.js +7 -0
  87. package/lib/components/datagrid/body/cell/data_grid_cell_actions.js +2 -2
  88. package/lib/components/datagrid/body/cell/data_grid_cell_actions.styles.js +1 -1
  89. package/lib/components/datagrid/body/data_grid_body.js +7 -0
  90. package/lib/components/datagrid/body/data_grid_body_custom.js +7 -0
  91. package/lib/components/datagrid/body/data_grid_body_virtualized.js +7 -0
  92. package/lib/components/datagrid/body/header/data_grid_header_cell.js +7 -0
  93. package/lib/components/datagrid/controls/column_sorting.js +7 -0
  94. package/lib/components/datagrid/controls/data_grid_toolbar_control.js +18 -1
  95. package/lib/components/datagrid/utils/in_memory.js +7 -0
  96. package/lib/components/date_picker/auto_refresh/auto_refresh.js +7 -0
  97. package/lib/components/filter_group/filter_button.js +96 -22
  98. package/lib/components/filter_group/filter_button.styles.js +51 -15
  99. package/lib/components/filter_group/filter_group.styles.js +18 -6
  100. package/lib/components/header/header_links/header_link.js +7 -0
  101. package/lib/components/header/header_section/header_section_item_button.js +7 -0
  102. package/lib/components/list_group/list_group.js +7 -0
  103. package/lib/components/list_group/list_group_item.js +7 -0
  104. package/lib/components/list_group/list_group_item_extra_action.js +7 -0
  105. package/lib/components/list_group/pinnable_list_group/pinnable_list_group.js +7 -0
  106. package/lib/components/pagination/pagination_button.js +7 -0
  107. package/lib/components/search_bar/filters/field_value_selection_filter.js +1 -0
  108. package/lib/components/search_bar/filters/field_value_toggle_filter.js +3 -1
  109. package/lib/components/search_bar/filters/field_value_toggle_group_filter.js +3 -1
  110. package/lib/components/search_bar/filters/is_filter.js +3 -1
  111. package/lib/components/search_bar/search_bar.a11y.js +3 -3
  112. package/lib/components/table/table_header_cell.js +28 -10
  113. package/lib/components/tool_tip/tool_tip.js +4 -1
  114. package/lib/global_styling/mixins/_button.js +106 -30
  115. package/lib/global_styling/mixins/_color.js +11 -4
  116. package/lib/services/theme/index.js +41 -1
  117. package/lib/services/theme/provider.js +28 -2
  118. package/lib/services/theme/theme_variant.js +28 -0
  119. package/lib/test/index.d.ts +2 -1
  120. package/lib/themes/amsterdam/global_styling/variables/_buttons.js +348 -147
  121. package/lib/themes/amsterdam/global_styling/variables/_components.js +229 -224
  122. package/lib/themes/amsterdam/theme.js +2 -1
  123. package/optimize/es/components/badge/color_utils.js +1 -3
  124. package/optimize/es/components/badge/notification_badge/badge_notification.styles.js +6 -1
  125. package/optimize/es/components/breadcrumbs/_breadcrumb_content.styles.js +6 -3
  126. package/optimize/es/components/button/button_display/_button_display.js +1 -1
  127. package/optimize/es/components/button/button_display/_button_display.styles.js +11 -2
  128. package/optimize/es/components/button/button_display/_button_display_content.styles.js +6 -3
  129. package/optimize/es/components/button/button_empty/button_empty.styles.js +9 -12
  130. package/optimize/es/components/button/button_group/button_group.styles.js +5 -3
  131. package/optimize/es/components/button/button_group/button_group_button.js +12 -8
  132. package/optimize/es/components/button/button_group/button_group_button.styles.js +43 -19
  133. package/optimize/es/components/button/button_icon/button_icon.js +4 -2
  134. package/optimize/es/components/color_picker/color_picker.js +13 -8
  135. package/optimize/es/components/color_picker/hue.js +22 -6
  136. package/optimize/es/components/color_picker/hue.styles.js +3 -2
  137. package/optimize/es/components/color_picker/saturation.js +16 -11
  138. package/optimize/es/components/color_picker/saturation.styles.js +2 -1
  139. package/optimize/es/components/datagrid/body/cell/data_grid_cell_actions.js +2 -2
  140. package/optimize/es/components/datagrid/body/cell/data_grid_cell_actions.styles.js +1 -1
  141. package/optimize/es/components/datagrid/controls/data_grid_toolbar_control.js +11 -1
  142. package/optimize/es/components/filter_group/filter_button.js +78 -21
  143. package/optimize/es/components/filter_group/filter_button.styles.js +51 -15
  144. package/optimize/es/components/filter_group/filter_group.styles.js +18 -6
  145. package/optimize/es/components/search_bar/filters/field_value_selection_filter.js +1 -0
  146. package/optimize/es/components/search_bar/filters/field_value_toggle_filter.js +3 -1
  147. package/optimize/es/components/search_bar/filters/field_value_toggle_group_filter.js +3 -1
  148. package/optimize/es/components/search_bar/filters/is_filter.js +3 -1
  149. package/optimize/es/components/search_bar/search_bar.a11y.js +3 -3
  150. package/optimize/es/components/table/table_header_cell.js +26 -11
  151. package/optimize/es/components/tool_tip/tool_tip.js +4 -1
  152. package/optimize/es/global_styling/mixins/_button.js +103 -31
  153. package/optimize/es/global_styling/mixins/_color.js +4 -2
  154. package/optimize/es/services/theme/index.js +2 -1
  155. package/optimize/es/services/theme/provider.js +28 -2
  156. package/optimize/es/services/theme/theme_variant.js +22 -0
  157. package/optimize/es/test/index.d.ts +2 -1
  158. package/optimize/es/themes/amsterdam/global_styling/variables/_buttons.js +348 -147
  159. package/optimize/es/themes/amsterdam/global_styling/variables/_components.js +229 -224
  160. package/optimize/es/themes/amsterdam/theme.js +2 -1
  161. package/optimize/lib/components/badge/color_utils.js +1 -3
  162. package/optimize/lib/components/badge/notification_badge/badge_notification.styles.js +6 -1
  163. package/optimize/lib/components/breadcrumbs/_breadcrumb_content.styles.js +5 -2
  164. package/optimize/lib/components/button/button_display/_button_display.js +1 -1
  165. package/optimize/lib/components/button/button_display/_button_display.styles.js +11 -2
  166. package/optimize/lib/components/button/button_display/_button_display_content.styles.js +6 -3
  167. package/optimize/lib/components/button/button_empty/button_empty.styles.js +10 -11
  168. package/optimize/lib/components/button/button_group/button_group.styles.js +5 -3
  169. package/optimize/lib/components/button/button_group/button_group_button.js +11 -7
  170. package/optimize/lib/components/button/button_group/button_group_button.styles.js +41 -17
  171. package/optimize/lib/components/button/button_icon/button_icon.js +3 -1
  172. package/optimize/lib/components/color_picker/color_picker.js +13 -8
  173. package/optimize/lib/components/color_picker/hue.js +21 -5
  174. package/optimize/lib/components/color_picker/hue.styles.js +3 -2
  175. package/optimize/lib/components/color_picker/saturation.js +16 -11
  176. package/optimize/lib/components/color_picker/saturation.styles.js +2 -1
  177. package/optimize/lib/components/datagrid/body/cell/data_grid_cell_actions.js +2 -2
  178. package/optimize/lib/components/datagrid/body/cell/data_grid_cell_actions.styles.js +1 -1
  179. package/optimize/lib/components/datagrid/controls/data_grid_toolbar_control.js +11 -1
  180. package/optimize/lib/components/filter_group/filter_button.js +76 -19
  181. package/optimize/lib/components/filter_group/filter_button.styles.js +51 -15
  182. package/optimize/lib/components/filter_group/filter_group.styles.js +18 -6
  183. package/optimize/lib/components/search_bar/filters/field_value_selection_filter.js +1 -0
  184. package/optimize/lib/components/search_bar/filters/field_value_toggle_filter.js +3 -1
  185. package/optimize/lib/components/search_bar/filters/field_value_toggle_group_filter.js +3 -1
  186. package/optimize/lib/components/search_bar/filters/is_filter.js +3 -1
  187. package/optimize/lib/components/search_bar/search_bar.a11y.js +3 -3
  188. package/optimize/lib/components/table/table_header_cell.js +25 -11
  189. package/optimize/lib/components/tool_tip/tool_tip.js +4 -1
  190. package/optimize/lib/global_styling/mixins/_button.js +101 -30
  191. package/optimize/lib/global_styling/mixins/_color.js +4 -2
  192. package/optimize/lib/services/theme/index.js +41 -1
  193. package/optimize/lib/services/theme/provider.js +28 -2
  194. package/optimize/lib/services/theme/theme_variant.js +28 -0
  195. package/optimize/lib/test/index.d.ts +2 -1
  196. package/optimize/lib/themes/amsterdam/global_styling/variables/_buttons.js +348 -147
  197. package/optimize/lib/themes/amsterdam/global_styling/variables/_components.js +229 -224
  198. package/optimize/lib/themes/amsterdam/theme.js +2 -1
  199. package/package.json +7 -6
  200. package/test-env/components/accessibility/skip_link/skip_link.js +7 -0
  201. package/test-env/components/badge/color_utils.js +1 -3
  202. package/test-env/components/badge/notification_badge/badge_notification.styles.js +6 -1
  203. package/test-env/components/breadcrumbs/_breadcrumb_content.styles.js +5 -2
  204. package/test-env/components/button/button.js +7 -0
  205. package/test-env/components/button/button_display/_button_display.js +1 -1
  206. package/test-env/components/button/button_display/_button_display.styles.js +11 -2
  207. package/test-env/components/button/button_display/_button_display_content.styles.js +6 -3
  208. package/test-env/components/button/button_empty/button_empty.js +7 -0
  209. package/test-env/components/button/button_empty/button_empty.styles.js +10 -11
  210. package/test-env/components/button/button_group/button_group.js +5 -0
  211. package/test-env/components/button/button_group/button_group.styles.js +5 -3
  212. package/test-env/components/button/button_group/button_group_button.js +18 -8
  213. package/test-env/components/button/button_group/button_group_button.styles.js +41 -17
  214. package/test-env/components/button/button_icon/button_icon.js +10 -1
  215. package/test-env/components/card/card.js +7 -0
  216. package/test-env/components/card/card_select/card_select.js +7 -0
  217. package/test-env/components/collapsible_nav_beta/_kibana_solution/collapsible_nav_kibana_solution.js +7 -0
  218. package/test-env/components/color_picker/color_picker.js +13 -8
  219. package/test-env/components/color_picker/hue.js +21 -5
  220. package/test-env/components/color_picker/hue.styles.js +3 -2
  221. package/test-env/components/color_picker/saturation.js +16 -11
  222. package/test-env/components/color_picker/saturation.styles.js +2 -1
  223. package/test-env/components/datagrid/body/cell/data_grid_cell.js +7 -0
  224. package/test-env/components/datagrid/body/cell/data_grid_cell_actions.js +2 -2
  225. package/test-env/components/datagrid/body/cell/data_grid_cell_actions.styles.js +1 -1
  226. package/test-env/components/datagrid/body/data_grid_body.js +7 -0
  227. package/test-env/components/datagrid/body/data_grid_body_custom.js +7 -0
  228. package/test-env/components/datagrid/body/data_grid_body_virtualized.js +7 -0
  229. package/test-env/components/datagrid/body/header/data_grid_header_cell.js +7 -0
  230. package/test-env/components/datagrid/controls/column_sorting.js +7 -0
  231. package/test-env/components/datagrid/controls/data_grid_toolbar_control.js +18 -1
  232. package/test-env/components/datagrid/utils/in_memory.js +7 -0
  233. package/test-env/components/date_picker/auto_refresh/auto_refresh.js +7 -0
  234. package/test-env/components/filter_group/filter_button.js +96 -22
  235. package/test-env/components/filter_group/filter_button.styles.js +51 -15
  236. package/test-env/components/filter_group/filter_group.styles.js +18 -6
  237. package/test-env/components/header/header_links/header_link.js +7 -0
  238. package/test-env/components/header/header_section/header_section_item_button.js +7 -0
  239. package/test-env/components/list_group/list_group.js +7 -0
  240. package/test-env/components/list_group/list_group_item.js +7 -0
  241. package/test-env/components/list_group/list_group_item_extra_action.js +7 -0
  242. package/test-env/components/list_group/pinnable_list_group/pinnable_list_group.js +7 -0
  243. package/test-env/components/pagination/pagination_button.js +7 -0
  244. package/test-env/components/search_bar/filters/field_value_selection_filter.js +1 -0
  245. package/test-env/components/search_bar/filters/field_value_toggle_filter.js +3 -1
  246. package/test-env/components/search_bar/filters/field_value_toggle_group_filter.js +3 -1
  247. package/test-env/components/search_bar/filters/is_filter.js +3 -1
  248. package/test-env/components/search_bar/search_bar.a11y.js +3 -3
  249. package/test-env/components/table/table_header_cell.js +26 -12
  250. package/test-env/components/tool_tip/tool_tip.js +4 -1
  251. package/test-env/global_styling/mixins/_button.js +101 -30
  252. package/test-env/global_styling/mixins/_color.js +4 -2
  253. package/test-env/services/theme/index.js +41 -1
  254. package/test-env/services/theme/provider.js +28 -2
  255. package/test-env/services/theme/theme_variant.js +28 -0
  256. package/test-env/themes/amsterdam/global_styling/variables/_buttons.js +348 -147
  257. package/test-env/themes/amsterdam/global_styling/variables/_components.js +229 -224
  258. package/test-env/themes/amsterdam/theme.js +2 -1
@@ -19,6 +19,7 @@ import { keys, useMouseMove, useEuiMemoizedStyles, useGeneratedHtmlId } from '..
19
19
  import { isNil } from '../../services/predicate';
20
20
  import { logicalStyles } from '../../global_styling';
21
21
  import { useEuiI18n } from '../i18n';
22
+ import { EuiToolTip } from '../tool_tip';
22
23
  import { getEventPosition } from './utils';
23
24
  import { euiSaturationStyles } from './saturation.styles';
24
25
  import { jsx as ___EmotionJSX } from "@emotion/react";
@@ -41,10 +42,11 @@ export var EuiSaturation = /*#__PURE__*/forwardRef(function (_ref, ref) {
41
42
  });
42
43
  var instructionsId = "".concat(id, "-instructions");
43
44
  var indicatorId = "".concat(id, "-saturationIndicator");
44
- var _useEuiI18n = useEuiI18n(['euiSaturation.ariaLabel', 'euiSaturation.screenReaderInstructions'], ['HSV color mode saturation and value 2-axis slider', "Arrow keys to navigate the square color gradient. Coordinates will be used to calculate HSV color mode 'saturation' and 'value' numbers, in the range of 0 to 1. Left and right to change the saturation. Up and down change the value."]),
45
- _useEuiI18n2 = _slicedToArray(_useEuiI18n, 2),
46
- roleDescString = _useEuiI18n2[0],
47
- instructionsString = _useEuiI18n2[1];
45
+ var _useEuiI18n = useEuiI18n(['euiSaturation.ariaLabel', 'euiSaturation.roleDescription', 'euiSaturation.screenReaderInstructions'], ['Select a color', 'HSV color mode saturation and value 2-axis slider.', "Arrow keys to navigate the square color gradient. Coordinates will be used to calculate HSV color mode 'saturation' and 'value' numbers, in the range of 0 to 1. Left and right to change the saturation. Up and down change the value."]),
46
+ _useEuiI18n2 = _slicedToArray(_useEuiI18n, 3),
47
+ ariaLabel = _useEuiI18n2[0],
48
+ roleDescString = _useEuiI18n2[1],
49
+ instructionsString = _useEuiI18n2[2];
48
50
  var _useState = useState({
49
51
  left: 0,
50
52
  top: 0
@@ -166,18 +168,21 @@ export var EuiSaturation = /*#__PURE__*/forwardRef(function (_ref, ref) {
166
168
  }, ___EmotionJSX("div", {
167
169
  css: styles.euiSaturation__saturation,
168
170
  className: "euiSaturation__saturation"
169
- })), ___EmotionJSX("button", {
171
+ })), ___EmotionJSX(EuiToolTip, {
172
+ content: hex,
173
+ anchorProps: {
174
+ css: styles.euiSaturation__tooltip,
175
+ style: logicalStyles(indicator)
176
+ },
177
+ disableScreenReaderOutput: true // required to prevent verbose screen reader output
178
+ }, ___EmotionJSX("button", {
170
179
  id: indicatorId,
171
180
  css: styles.euiSaturation__indicator,
172
181
  className: "euiSaturation__indicator",
173
- style: logicalStyles(indicator),
174
182
  "aria-roledescription": roleDescString,
175
- "aria-label": hex,
183
+ "aria-label": ariaLabel,
176
184
  "aria-describedby": instructionsId
177
- }), ___EmotionJSX("span", {
178
- hidden: true,
179
- "aria-live": "assertive"
180
- }, hex), ___EmotionJSX("span", {
185
+ })), ___EmotionJSX("span", {
181
186
  hidden: true,
182
187
  id: instructionsId
183
188
  }, instructionsString));
@@ -30,7 +30,8 @@ export var euiSaturationStyles = function euiSaturationStyles(euiThemeContext) {
30
30
  }), ";;label:euiSaturation;"),
31
31
  euiSaturation__lightness: /*#__PURE__*/css("position:absolute;inset:0;border-radius:", gradientBorderRadius, ";background:linear-gradient(\n to right,\n rgba(255, 255, 255, 1),\n rgba(255, 255, 255, 0)\n );;label:euiSaturation__lightness;"),
32
32
  euiSaturation__saturation: /*#__PURE__*/css("position:absolute;inset:0;border-radius:", gradientBorderRadius, ";background:linear-gradient(to top, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0));;label:euiSaturation__saturation;"),
33
- euiSaturation__indicator: /*#__PURE__*/css("z-index:2;position:absolute;", logicalSizeCSS(indicatorSize), " transform:translateX(-50%) translateY(-50%);border-radius:100%;", highContrastModeStyles(euiThemeContext, {
33
+ euiSaturation__tooltip: /*#__PURE__*/css("z-index:2;position:absolute;", logicalSizeCSS(indicatorSize), " transform:translateX(-50%) translateY(-50%);border-radius:100%;;label:euiSaturation__tooltip;"),
34
+ euiSaturation__indicator: /*#__PURE__*/css("position:absolute;inset:0;", logicalSizeCSS(indicatorSize), " border-radius:100%;", highContrastModeStyles(euiThemeContext, {
34
35
  none: "\n border: ".concat(euiTheme.border.width.thin, " solid ").concat(euiTheme.colors.darkestShade, ";\n\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n border-radius: 100%;\n border: ").concat(euiTheme.border.width.thin, " solid\n ").concat(euiTheme.colors.lightestShade, ";\n }\n "),
35
36
  preferred: "\n border: ".concat(euiTheme.border.width.thick, " solid ").concat(euiTheme.colors.ink, ";\n background-color: ").concat(euiTheme.colors.ghost, ";\n ")
36
37
  }), ";;label:euiSaturation__indicator;")
@@ -42,8 +42,8 @@ export var EuiDataGridCellActions = function EuiDataGridCellActions(_ref) {
42
42
  "data-test-subj": "euiDataGridCellExpandButton",
43
43
  display: "fill",
44
44
  color: "primary",
45
- iconSize: "m",
46
- iconType: "expandMini",
45
+ iconSize: "s",
46
+ iconType: "expand",
47
47
  "aria-hidden": true,
48
48
  onClick: onExpandClick,
49
49
  title: expandButtonTitle
@@ -28,7 +28,7 @@ export var euiDataGridCellActionsStyles = function euiDataGridCellActionsStyles(
28
28
  })), " background-color:inherit;}", cellSelectors.hoverColor, " &{background-color:", cellOutline.hoverColor, ";border-color:", cellOutline.hoverColor, ";}", euiCanAnimate, "{transform:scaleY(0);transform-origin:bottom;", cellSelectors.showAnimation, " &{animation-duration:", euiTheme.animation.fast, ";animation-name:", slideUp, ";animation-iteration-count:1;animation-fill-mode:forwards;}", cellSelectors.hoverAnimation, " &{animation-delay:", euiTheme.animation.slow, ";}};label:euiDataGridRowCell__actions;"),
29
29
  euiDataGridRowCell__actionButtonIcon: /*#__PURE__*/css(logicalCSS('width', euiTheme.size.base), " ", logicalCSS('height', mathWithUnits([euiTheme.size.base, euiTheme.size.xs], function (x, y) {
30
30
  return x + y;
31
- })), " border-radius:0;&,svg{background-color:transparent!important;color:currentColor!important;fill:currentColor!important;}&.euiDataGridRowCell__expandCell .euiIcon{", logicalCSS('width', '120%'), " ", logicalCSS('height', '100%'), ";}", highContrastModeStyles(euiThemeContext, {
31
+ })), " border-radius:0;&,svg{background-color:transparent!important;color:currentColor!important;fill:currentColor!important;}", highContrastModeStyles(euiThemeContext, {
32
32
  preferred: 'border: none;'
33
33
  }), ";;label:euiDataGridRowCell__actionButtonIcon;")
34
34
  };
@@ -13,6 +13,7 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
13
13
  import React from 'react';
14
14
  import classNames from 'classnames';
15
15
  import { css } from '@emotion/react';
16
+ import { useEuiTheme, useEuiThemeRefreshVariant } from '../../../services';
16
17
  import { EuiButtonEmpty } from '../../button';
17
18
  import { EuiNotificationBadge } from '../../badge';
18
19
  import { useEuiI18n } from '../../i18n';
@@ -23,7 +24,12 @@ export var EuiDataGridToolbarControl = function EuiDataGridToolbarControl(_ref)
23
24
  badgeContent = _ref.badgeContent,
24
25
  textProps = _ref.textProps,
25
26
  rest = _objectWithoutProperties(_ref, _excluded);
27
+ var euiThemeContext = useEuiTheme();
28
+ var isRefreshVariant = useEuiThemeRefreshVariant('buttonVariant');
26
29
  var classes = classNames('euiDataGridToolbarControl', className);
30
+ var cssStyles = isRefreshVariant ?
31
+ // passes euiThemeContext here instead via `css` to ensure legacy Enzyme tests work
32
+ interactiveStyles(euiThemeContext) : underlineStyles;
27
33
  var badgeAriaLabel = useEuiI18n('euiDataGridToolbarControl.badgeAriaLabel', 'Active: {count}', {
28
34
  count: typeof badgeContent === 'string' ? betterScreenReaderSlashes(badgeContent) : badgeContent
29
35
  });
@@ -32,7 +38,7 @@ export var EuiDataGridToolbarControl = function EuiDataGridToolbarControl(_ref)
32
38
  size: "xs",
33
39
  color: "text",
34
40
  textProps: false,
35
- css: underlineStyles
41
+ css: cssStyles
36
42
  }, rest), ___EmotionJSX("span", _extends({}, textProps, {
37
43
  className: classNames('euiDataGridToolbarControl__text', 'eui-textTruncate', textProps && textProps.className)
38
44
  }), children), Boolean(badgeContent) && ___EmotionJSX(EuiNotificationBadge, {
@@ -60,6 +66,10 @@ var underlineStyles = process.env.NODE_ENV === "production" ? {
60
66
  styles: "&:focus,&:hover:not(:disabled){text-decoration:none;.euiDataGridToolbarControl__text{text-decoration:underline;}};label:underlineStyles;",
61
67
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
62
68
  };
69
+ var interactiveStyles = function interactiveStyles(_ref2) {
70
+ var euiTheme = _ref2.euiTheme;
71
+ return /*#__PURE__*/css("&:focus,&:hover:not(:disabled){.euiDataGridToolbarControl__badge{background-color:", euiTheme.components.filterButtonBadgeBackgroundHover, ";}};label:interactiveStyles;");
72
+ };
63
73
  var badgeStyles = process.env.NODE_ENV === "production" ? {
64
74
  name: "1968nw3-badgeStyles",
65
75
  styles: "cursor:inherit;label:badgeStyles;"
@@ -1,8 +1,8 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ import _extends from "@babel/runtime/helpers/extends";
3
3
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
5
- var _excluded = ["children", "className", "iconType", "iconSide", "color", "badgeColor", "hasActiveFilters", "numFilters", "numActiveFilters", "isDisabled", "isSelected", "type", "grow", "withNext", "textProps", "contentProps"];
5
+ var _excluded = ["children", "className", "iconType", "iconSide", "color", "badgeColor", "hasActiveFilters", "numFilters", "numActiveFilters", "isToggle", "isDisabled", "isSelected", "type", "grow", "withNext", "textProps", "contentProps"];
6
6
  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; }
7
7
  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; }
8
8
  /*
@@ -15,12 +15,14 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
15
15
 
16
16
  import React from 'react';
17
17
  import classNames from 'classnames';
18
- import { useEuiMemoizedStyles } from '../../services';
18
+ import { EuiThemeProvider, useEuiMemoizedStyles, useEuiTheme, useGeneratedHtmlId, useEuiThemeRefreshVariant } from '../../services';
19
19
  import { useEuiI18n } from '../i18n';
20
20
  import { useInnerText } from '../inner_text';
21
21
  import { EuiNotificationBadge } from '../badge';
22
22
  import { EuiButtonEmpty } from '../button/button_empty';
23
- import { euiFilterButtonStyles, euiFilterButtonChildStyles } from './filter_button.styles';
23
+ import { euiFilterButtonStyles, euiFilterButtonWrapperStyles, euiFilterButtonChildStyles } from './filter_button.styles';
24
+ import { EuiButtonGroupButton } from '../button/button_group/button_group_button';
25
+ import { _compressedButtonFocusColors } from '../button/button_group/button_group_button.styles';
24
26
  import { jsx as ___EmotionJSX } from "@emotion/react";
25
27
  export var EuiFilterButton = function EuiFilterButton(_ref) {
26
28
  var children = _ref.children,
@@ -35,6 +37,7 @@ export var EuiFilterButton = function EuiFilterButton(_ref) {
35
37
  hasActiveFilters = _ref.hasActiveFilters,
36
38
  numFilters = _ref.numFilters,
37
39
  numActiveFilters = _ref.numActiveFilters,
40
+ isToggle = _ref.isToggle,
38
41
  isDisabled = _ref.isDisabled,
39
42
  isSelected = _ref.isSelected,
40
43
  _ref$type = _ref.type,
@@ -45,18 +48,37 @@ export var EuiFilterButton = function EuiFilterButton(_ref) {
45
48
  textProps = _ref.textProps,
46
49
  contentProps = _ref.contentProps,
47
50
  rest = _objectWithoutProperties(_ref, _excluded);
51
+ var id = useGeneratedHtmlId({
52
+ prefix: 'filter-button'
53
+ });
48
54
  var numFiltersDefined = numFilters != null; // != instead of !== to allow for null and undefined
49
55
  var numActiveFiltersDefined = numActiveFilters != null && numActiveFilters > 0;
56
+ var euiThemeContext = useEuiTheme();
57
+ var colorMode = euiThemeContext.colorMode;
58
+ var isRefreshVariant = useEuiThemeRefreshVariant('buttonVariant');
59
+
60
+ // assumption about type of usage based on icon usage
61
+ // requires manual override to apply correct aria attributes for more custom usages
62
+ var isCollapsible = !isToggle && iconType === 'arrowDown';
63
+ // NOTE: in Amsterdam `hasActiveFilters` applies selected styling while `isSelected` does not.
64
+ // With Borealis this is more granular as EuiFilterButton now supports proper toggle buttons next to regular buttons
65
+ var isExpanded = isCollapsible && (isSelected !== null && isSelected !== void 0 ? isSelected : hasActiveFilters);
50
66
  var styles = useEuiMemoizedStyles(euiFilterButtonStyles);
51
- var cssStyles = [styles.euiFilterButton, withNext && styles.withNext, !grow && styles.noGrow, hasActiveFilters && styles.hasActiveFilters, numFiltersDefined && styles.hasNotification];
67
+ var focusColorStyles = useEuiMemoizedStyles(_compressedButtonFocusColors);
68
+ var toggleVariantStyles = isRefreshVariant ? [isToggle && styles.buttonType.toggle, !isToggle && !isDisabled && focusColorStyles[color], !isToggle && styles.buttonType.default] : [isToggle && styles.buttonType.toggle];
69
+ var cssStyles = [styles.euiFilterButton, !isRefreshVariant && withNext && styles.withNext, hasActiveFilters && styles.hasActiveFilters].concat(toggleVariantStyles);
70
+ var wrapperStyles = useEuiMemoizedStyles(euiFilterButtonWrapperStyles);
71
+ var wrapperCssStyles = [wrapperStyles.wrapper, isRefreshVariant && withNext && styles.withNext, numFiltersDefined && styles.hasNotification, isToggle && wrapperStyles.hasToggle, !grow && styles.noGrow];
52
72
  var _useEuiMemoizedStyles = useEuiMemoizedStyles(euiFilterButtonChildStyles),
53
73
  contentStyles = _useEuiMemoizedStyles.content,
54
74
  textStyles = _useEuiMemoizedStyles.text,
55
75
  notificationStyles = _useEuiMemoizedStyles.notification;
76
+ var wrapperClasses = classNames('euiFilterButton__wrapper');
56
77
  var classes = classNames('euiFilterButton', {
57
78
  'euiFilterButton-isSelected': isSelected,
58
79
  'euiFilterButton-hasActiveFilters': hasActiveFilters,
59
- 'euiFilterButton-hasNotification': numFiltersDefined
80
+ 'euiFilterButton-hasNotification': numFiltersDefined,
81
+ 'euiFilterButton-isToggle': isRefreshVariant && isToggle
60
82
  }, className);
61
83
 
62
84
  /**
@@ -71,6 +93,16 @@ export var EuiFilterButton = function EuiFilterButton(_ref) {
71
93
  count: badgeCount
72
94
  });
73
95
  var badgeStyles = [notificationStyles.euiFilterButton__notification, isDisabled && notificationStyles.disabled];
96
+ var badgeContent = ___EmotionJSX(EuiNotificationBadge, {
97
+ className: "euiFilterButton__notification",
98
+ css: badgeStyles,
99
+ "aria-label": hasActiveFilters ? activeBadgeLabel : availableBadgeLabel,
100
+ color: isDisabled || !hasActiveFilters ? 'subdued' : badgeColor,
101
+ role: "marquee" // https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/marquee_role
102
+ }, badgeCount);
103
+ var badgeElement = showBadge && (isRefreshVariant ? ___EmotionJSX(EuiThemeProvider, {
104
+ colorMode: isToggle && isSelected ? 'INVERSE' : colorMode
105
+ }, badgeContent) : badgeContent);
74
106
 
75
107
  /**
76
108
  * Text
@@ -84,7 +116,17 @@ export var EuiFilterButton = function EuiFilterButton(_ref) {
84
116
  ref = _useInnerText2[0],
85
117
  innerText = _useInnerText2[1];
86
118
  var dataText = children && typeof children === 'string' ? children : innerText;
87
- return ___EmotionJSX(EuiButtonEmpty, _extends({
119
+ var textContent = ___EmotionJSX("span", _extends({
120
+ ref: ref,
121
+ "data-text": dataText,
122
+ title: dataText
123
+ }, textProps, {
124
+ className: buttonTextClassNames,
125
+ css: textCssStyles
126
+ }), children);
127
+
128
+ /** Button element */
129
+ var button = ___EmotionJSX(EuiButtonEmpty, _extends({
88
130
  className: classes,
89
131
  css: cssStyles,
90
132
  color: color,
@@ -93,21 +135,36 @@ export var EuiFilterButton = function EuiFilterButton(_ref) {
93
135
  iconType: iconType,
94
136
  type: type,
95
137
  textProps: false,
138
+ contentProps: _objectSpread(_objectSpread({}, contentProps), {}, {
139
+ css: [contentStyles.euiFilterButton__content, iconType && contentStyles.hasIcon, contentProps === null || contentProps === void 0 ? void 0 : contentProps.css]
140
+ }),
141
+ "aria-expanded": isCollapsible ? isExpanded : undefined
142
+ }, rest), textContent, badgeElement);
143
+ var onToggleClick = function onToggleClick(e) {
144
+ var _rest$onClick;
145
+ rest === null || rest === void 0 || (_rest$onClick = rest.onClick) === null || _rest$onClick === void 0 || _rest$onClick.call(rest, e);
146
+ };
147
+ return ___EmotionJSX("div", {
148
+ className: wrapperClasses,
149
+ css: wrapperCssStyles
150
+ }, isToggle && !isCollapsible ? ___EmotionJSX(EuiButtonGroupButton, _extends({
151
+ id: id,
152
+ label: ___EmotionJSX(React.Fragment, null, textContent, badgeElement),
153
+ className: classes,
154
+ css: cssStyles,
155
+ color: color,
156
+ isSelected: isSelected,
157
+ size: "compressed",
158
+ isDisabled: isDisabled,
159
+ iconSide: iconSide,
160
+ iconType: iconType,
161
+ isIconOnly: false,
162
+ type: type,
163
+ textProps: false,
96
164
  contentProps: _objectSpread(_objectSpread({}, contentProps), {}, {
97
165
  css: [contentStyles.euiFilterButton__content, iconType && contentStyles.hasIcon, contentProps === null || contentProps === void 0 ? void 0 : contentProps.css]
98
166
  })
99
- }, rest), ___EmotionJSX("span", _extends({
100
- ref: ref,
101
- "data-text": dataText,
102
- title: dataText
103
- }, textProps, {
104
- className: buttonTextClassNames,
105
- css: textCssStyles
106
- }), children), showBadge && ___EmotionJSX(EuiNotificationBadge, {
107
- className: "euiFilterButton__notification",
108
- css: badgeStyles,
109
- "aria-label": hasActiveFilters ? activeBadgeLabel : availableBadgeLabel,
110
- color: isDisabled || !hasActiveFilters ? 'subdued' : badgeColor,
111
- role: "marquee" // https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/marquee_role
112
- }, badgeCount));
167
+ }, rest, {
168
+ onClick: onToggleClick
169
+ })) : button);
113
170
  };
@@ -8,14 +8,17 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
8
8
  */
9
9
 
10
10
  import { css } from '@emotion/react';
11
- import { logicalCSS, mathWithUnits, euiTextShift, euiTextTruncate } from '../../global_styling';
11
+ import { isEuiThemeRefreshVariant } from '../../services';
12
+ import { logicalCSS, mathWithUnits, euiTextShift, euiTextTruncate, highContrastModeStyles, preventForcedColors, euiButtonEmptyColor } from '../../global_styling';
13
+ import { cssSupportsHasWithNextSibling } from '../../global_styling/functions/supports';
12
14
  import { euiFormVariables } from '../form/form.styles';
13
- export var euiFilterButtonDisplay = function euiFilterButtonDisplay(_ref4) {
14
- var euiTheme = _ref4.euiTheme;
15
+ export var euiFilterButtonDisplay = function euiFilterButtonDisplay(euiThemeContext) {
16
+ var euiTheme = euiThemeContext.euiTheme;
17
+ var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'buttonVariant');
15
18
  return {
16
19
  flex: '1 1 auto',
17
20
  minInlineSize: mathWithUnits(euiTheme.size.base, function (x) {
18
- return x * 3;
21
+ return x * (isRefreshVariant ? 2.75 : 3);
19
22
  })
20
23
  };
21
24
  };
@@ -29,9 +32,11 @@ var _ref3 = process.env.NODE_ENV === "production" ? {
29
32
  };
30
33
  export var euiFilterButtonStyles = function euiFilterButtonStyles(euiThemeContext) {
31
34
  var euiTheme = euiThemeContext.euiTheme;
35
+ var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'buttonVariant');
32
36
  var _euiFormVariables = euiFormVariables(euiThemeContext),
33
37
  controlHeight = _euiFormVariables.controlHeight,
34
38
  borderColor = _euiFormVariables.borderColor;
39
+ var selectedSelector = '.euiFilterButton-isSelected';
35
40
  var border = "".concat(euiTheme.border.width.thin, " solid ").concat(borderColor);
36
41
 
37
42
  // Pseudo elements create borders without affecting width. We also prefer them
@@ -39,14 +44,44 @@ export var euiFilterButtonStyles = function euiFilterButtonStyles(euiThemeContex
39
44
  var leftBorder = "\n &::before {\n content: '';\n position: absolute;\n ".concat(logicalCSS('right', '100%'), "\n ").concat(logicalCSS('vertical', 0), "\n ").concat(logicalCSS('border-left', border), "\n }\n ");
40
45
  // Bottom borders are needed for responsive flex-wrap behavior
41
46
  var bottomBorder = "\n &::after {\n content: '';\n position: absolute;\n ".concat(logicalCSS('top', '100%'), "\n ").concat(logicalCSS('horizontal', 0), "\n ").concat(logicalCSS('border-bottom', border), "\n }\n ");
47
+ var buttonStyles = isRefreshVariant ? "\n ".concat(logicalCSS('width', '100%'), "\n\n &:not(").concat(selectedSelector, ") {\n &:hover,\n &:active {\n .euiFilterButton__notification[class*=\"subdued\"] {\n background-color: ").concat(euiTheme.components.filterButtonBadgeBackgroundHover, "\n }\n }\n }\n ") : "\n ".concat(logicalCSS('height', controlHeight), "\n border-radius: 0;\n ").concat(leftBorder, "\n ").concat(bottomBorder, "\n\n /* :not(:disabled) specificity needed to override EuiButtonEmpty styles */\n &:hover:not(:disabled),\n &:focus:not(:disabled) {\n /* Remove underline from whole button so notifications don't get the underline */\n text-decoration: none;\n\n .euiFilterButton__text {\n /* And put it only on the actual text part */\n text-decoration: underline;\n }\n }\n ");
48
+ var toggleTypeStyles = isRefreshVariant ? "\n ".concat(euiFilterButtonDisplay(euiThemeContext), ";\n\n ").concat(highContrastModeStyles(euiThemeContext, {
49
+ forced: "\n &:is(".concat(selectedSelector, ") {\n ").concat(preventForcedColors(euiThemeContext), "\n color: ").concat(euiTheme.colors.emptyShade, ";\n background-color: ").concat(euiTheme.colors.fullShade, ";\n }\n ")
50
+ }), "\n ") : "\n font-weight: ".concat(euiTheme.font.weight.medium, ";\n padding: 0;\n\n &:is(").concat(selectedSelector, ") {\n color: ").concat(euiButtonEmptyColor(euiThemeContext, 'text').color, ";\n background-color: transparent;\n font-weight: ").concat(euiTheme.font.weight.bold, ";\n }\n ");
51
+ var withNextSelector = isRefreshVariant ? '& + .euiFilterButton__wrapper' : '.euiFilterButton__wrapper:has(&) + .euiFilterButton__wrapper';
52
+ // handles display of borders between buttons
53
+ var withNextStyles = isRefreshVariant ? "\n &::before {\n border: none;\n }\n\n ".concat(cssSupportsHasWithNextSibling("\n &:has(+ :not(&)) {\n ".concat(logicalCSS('padding-right', '0'), "\n }\n ")), "\n ") : "\n .euiFilterButton {\n &::before {\n border: none;\n }\n }\n ";
42
54
  return {
43
- euiFilterButton: /*#__PURE__*/css("position:relative;", euiFilterButtonDisplay(euiThemeContext), " ", logicalCSS('height', controlHeight), " border-radius:0;", leftBorder, " ", bottomBorder, "&:hover:not(:disabled),&:focus:not(:disabled){text-decoration:none;.euiFilterButton__text{text-decoration:underline;}}&:focus-visible{outline-offset:-", euiTheme.focus.width, ";};label:euiFilterButton;"),
44
- withNext: /*#__PURE__*/css("&+.euiFilterButton{", logicalCSS('margin-left', "-".concat(euiTheme.size.xs)), "&::before{display:none;}};label:withNext;"),
55
+ euiFilterButton: /*#__PURE__*/css(!isRefreshVariant && euiFilterButtonDisplay(euiThemeContext), ";position:relative;", buttonStyles, ";;label:euiFilterButton;"),
56
+ buttonType: {
57
+ default: /*#__PURE__*/css(isRefreshVariant && "\n border-radius: 0;\n\n &:focus-visible {\n z-index: 1;\n outline-offset: -".concat(euiTheme.border.width.thick, ";\n border-radius: ").concat(euiTheme.border.radius.small, ";\n transition: none;\n }\n "), ";;label:default;"),
58
+ toggle: /*#__PURE__*/css("&:focus-visible{outline-offset:", mathWithUnits(euiTheme.focus.width, function (x) {
59
+ return isRefreshVariant ? x / 2 : x * -1;
60
+ }), ";}", toggleTypeStyles, ";;label:toggle;")
61
+ },
62
+ withNext: /*#__PURE__*/css(withNextSelector, "{", logicalCSS('margin-left', "-".concat(euiTheme.size.xs)), withNextStyles, ";};label:withNext;"),
45
63
  noGrow: _ref3,
46
64
  hasNotification: /*#__PURE__*/css(logicalCSS('min-width', mathWithUnits(euiTheme.size.base, function (x) {
47
65
  return x * 6;
48
66
  })), ";;label:hasNotification;"),
49
- hasActiveFilters: /*#__PURE__*/css("font-weight:", euiTheme.font.weight.bold, ";;label:hasActiveFilters;")
67
+ hasActiveFilters: /*#__PURE__*/css("font-weight:", isRefreshVariant ? euiTheme.font.weight.regular : euiTheme.font.weight.bold, ";;label:hasActiveFilters;")
68
+ };
69
+ };
70
+ export var euiFilterButtonWrapperStyles = function euiFilterButtonWrapperStyles(euiThemeContext) {
71
+ var euiTheme = euiThemeContext.euiTheme;
72
+ var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'buttonVariant');
73
+ var _euiFormVariables2 = euiFormVariables(euiThemeContext),
74
+ borderColor = _euiFormVariables2.borderColor;
75
+ var border = "".concat(euiTheme.border.width.thin, " solid ").concat(borderColor);
76
+
77
+ // Pseudo elements create borders without affecting width. We also prefer them
78
+ // over box-shadow for Windows high contrast theme compatibility
79
+ var leftBorder = "\n &::before {\n content: '';\n position: absolute;\n inset: 0;\n ".concat(logicalCSS('border-left', border), "\n\n pointer-events: none;\n }\n ");
80
+ // Bottom borders are needed for responsive flex-wrap behavior
81
+ var bottomBorder = "\n &::after {\n content: '';\n position: absolute;\n inset: 0;\n ".concat(logicalCSS('border-bottom', border), "\n pointer-events: none;\n }\n ");
82
+ return {
83
+ wrapper: /*#__PURE__*/css(euiFilterButtonDisplay(euiThemeContext), " position:relative;display:flex;align-items:center;", isRefreshVariant && "\n ".concat(leftBorder, "\n ").concat(bottomBorder, "\n "), " ", logicalCSS('padding-vertical', euiTheme.border.width.thin), ";;label:wrapper;"),
84
+ hasToggle: /*#__PURE__*/css(logicalCSS('padding-horizontal', isRefreshVariant ? euiTheme.border.width.thin : '0'), cssSupportsHasWithNextSibling("\n &:not([class*=\"withNext\"]):has(+ :not(&)) {\n ".concat(logicalCSS('padding-right', '0'), "\n }\n ")), ";;label:hasToggle;")
50
85
  };
51
86
  };
52
87
  var _ref = process.env.NODE_ENV === "production" ? {
@@ -58,24 +93,25 @@ var _ref = process.env.NODE_ENV === "production" ? {
58
93
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
59
94
  };
60
95
  var _ref2 = process.env.NODE_ENV === "production" ? {
61
- name: "nd1u8j-euiFilterButton__notification",
62
- styles: "cursor:inherit;label:euiFilterButton__notification;"
96
+ name: "zxesfz-euiFilterButton__notification",
97
+ styles: "cursor:inherit;forced-color-adjust:auto;&{transition:none;};label:euiFilterButton__notification;"
63
98
  } : {
64
- name: "nd1u8j-euiFilterButton__notification",
65
- styles: "cursor:inherit;label:euiFilterButton__notification;",
99
+ name: "zxesfz-euiFilterButton__notification",
100
+ styles: "cursor:inherit;forced-color-adjust:auto;&{transition:none;};label:euiFilterButton__notification;",
66
101
  toString: _EMOTION_STRINGIFIED_CSS_ERROR__
67
102
  };
68
- export var euiFilterButtonChildStyles = function euiFilterButtonChildStyles(_ref5) {
69
- var euiTheme = _ref5.euiTheme;
103
+ export var euiFilterButtonChildStyles = function euiFilterButtonChildStyles(euiThemeContext) {
104
+ var euiTheme = euiThemeContext.euiTheme;
105
+ var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'buttonVariant');
70
106
  return {
71
107
  content: {
72
- euiFilterButton__content: /*#__PURE__*/css(";label:euiFilterButton__content;"),
108
+ euiFilterButton__content: /*#__PURE__*/css(isRefreshVariant && "\n .euiThemeProvider {\n display: inline-flex;\n }\n ", ";;label:euiFilterButton__content;"),
73
109
  hasIcon: /*#__PURE__*/css("&>.euiIcon:last-child{", logicalCSS('margin-left', 'auto'), ";};label:hasIcon;")
74
110
  },
75
111
  text: {
76
112
  euiFilterButton__text: /*#__PURE__*/css(euiTextShift('bold', 'data-text', euiTheme), " ", euiTextTruncate(), ";;label:euiFilterButton__text;"),
77
113
  hasNotification: /*#__PURE__*/css(logicalCSS('min-width', mathWithUnits(euiTheme.size.base, function (x) {
78
- return x * 3;
114
+ return x * (isRefreshVariant ? 2 : 3);
79
115
  })), ";;label:hasNotification;")
80
116
  },
81
117
  notification: {
@@ -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, mathWithUnits, euiBreakpoint } from '../../global_styling';
12
13
  import { highContrastModeStyles } from '../../global_styling/functions/high_contrast';
13
14
  import { euiFormVariables } from '../form/form.styles';
@@ -22,20 +23,31 @@ var _ref = process.env.NODE_ENV === "production" ? {
22
23
  };
23
24
  export var euiFilterGroupStyles = function euiFilterGroupStyles(euiThemeContext) {
24
25
  var euiTheme = euiThemeContext.euiTheme;
26
+ var isRefreshVariant = isEuiThemeRefreshVariant(euiThemeContext, 'buttonVariant');
25
27
  var _euiFormVariables = euiFormVariables(euiThemeContext),
26
28
  backgroundColor = _euiFormVariables.backgroundColor,
27
29
  borderColor = _euiFormVariables.borderColor,
28
30
  controlBorderRadius = _euiFormVariables.controlBorderRadius,
31
+ controlHeight = _euiFormVariables.controlHeight,
29
32
  controlCompressedBorderRadius = _euiFormVariables.controlCompressedBorderRadius,
30
33
  controlCompressedHeight = _euiFormVariables.controlCompressedHeight;
34
+ var borderRadius = isRefreshVariant ? euiTheme.border.radius.small : controlBorderRadius;
35
+ var borderRadiusCompressed = isRefreshVariant ? euiTheme.border.radius.small : controlCompressedBorderRadius;
36
+ var borderStyle = isRefreshVariant ? "\n /* Adds the border on a pseudo element to prevent height differences between wrapper and buttons.\n Uses ::after to ensure overlap and prevents blocking by setting pointer-events: none */\n &::after {\n content: '';\n position: absolute;\n inset: 0;\n border: ".concat(euiTheme.border.width.thin, " solid ").concat(euiTheme.colors.borderBasePlain, ";\n border-radius: inherit;\n pointer-events: none;\n }\n ") : "\n ".concat(highContrastModeStyles(euiThemeContext, {
37
+ none: "box-shadow: inset 0 0 0 ".concat(euiTheme.border.width.thin, " ").concat(borderColor, ";"),
38
+ forced: "border: ".concat(euiTheme.border.thin, ";")
39
+ }), "\n ");
31
40
  return {
32
- euiFilterGroup: /*#__PURE__*/css("display:inline-flex;", logicalCSS('max-width', '100%'), " overflow:hidden;background-color:", backgroundColor, ";", highContrastModeStyles(euiThemeContext, {
33
- none: "box-shadow: inset 0 0 0 ".concat(euiTheme.border.width.thin, " ").concat(borderColor, ";"),
34
- forced: "border: ".concat(euiTheme.border.thin, ";")
35
- }), ">*:not(.euiFilterButton){", euiFilterButtonDisplay(euiThemeContext), ";}.euiPopover>.euiFilterButton{", logicalCSS('width', '100%'), ";}", euiBreakpoint(euiThemeContext, ['xs', 's']), "{flex-wrap:wrap;}", euiBreakpoint(euiThemeContext, ['xs']), "{display:flex;.euiFilterButton{flex-grow:1;}};label:euiFilterGroup;"),
41
+ euiFilterGroup: /*#__PURE__*/css(isRefreshVariant && "position: relative;", " display:inline-flex;", logicalCSS('max-width', '100%'), " overflow:hidden;background-color:", backgroundColor, ";", borderStyle, ">*:not(.euiFilterButton__wrapper, .euiFilterButton){", euiFilterButtonDisplay(euiThemeContext), ";}.euiPopover>.euiFilterButton{", logicalCSS('width', '100%'), ";}", euiBreakpoint(euiThemeContext, ['xs', 's']), "{flex-wrap:wrap;}", euiBreakpoint(euiThemeContext, ['xs']), "{display:flex;", isRefreshVariant && "\n .euiPopover:focus-within {\n z-index: 1;\n }\n \n .euiFilterButton__wrapper {\n flex-grow: 1;\n }\n ", ";.euiFilterButton__wrapper{flex-grow:1;}};label:euiFilterGroup;"),
36
42
  fullWidth: _ref,
37
- uncompressed: /*#__PURE__*/css("border-radius:", controlBorderRadius, ";", buttonChildrenBorderRadii(controlBorderRadius), ";;label:uncompressed;"),
38
- compressed: /*#__PURE__*/css("border-radius:", controlCompressedBorderRadius, ";", buttonChildrenBorderRadii(controlCompressedBorderRadius), " .euiFilterButton{", logicalCSS('height', controlCompressedHeight), ";};label:compressed;"),
43
+ uncompressed: /*#__PURE__*/css("border-radius:", borderRadius, ";.euiFilterButton__wrapper{", logicalCSS('height', controlHeight), ";}.euiFilterButton{", logicalCSS('height', controlHeight), ";}", !isRefreshVariant && buttonChildrenBorderRadii(borderRadius), " ", isRefreshVariant && "\n .euiFilterButton-isToggle {\n ".concat(logicalCSS('height', mathWithUnits([controlHeight, euiTheme.size.xxs], function (x, y) {
44
+ return x - 3 * y;
45
+ })), "\n }\n "), ";;label:uncompressed;"),
46
+ compressed: /*#__PURE__*/css("border-radius:", borderRadiusCompressed, ";", !isRefreshVariant && buttonChildrenBorderRadii(borderRadiusCompressed), " .euiFilterButton{", logicalCSS('height', isRefreshVariant ? mathWithUnits([controlCompressedHeight, euiTheme.border.width.thin], function (x, y) {
47
+ return x - 2 * y;
48
+ }) : controlCompressedHeight), ";}", isRefreshVariant && "\n .euiFilterButton-isToggle {\n ".concat(logicalCSS('height', mathWithUnits([controlCompressedHeight, euiTheme.size.xxs], function (x, y) {
49
+ return x - 3 * y;
50
+ })), "\n }\n "), ";;label:compressed;"),
39
51
  /**
40
52
  * Not used in EuiFilterGroup directly, but used by EuiSearchBar and consumers
41
53
  * A fixed width is required because of the shift in widths that can be caused
@@ -284,6 +284,7 @@ export var FieldValueSelectionFilter = /*#__PURE__*/function (_Component) {
284
284
  return ___EmotionJSX(EuiFilterButton, {
285
285
  iconType: "arrowDown",
286
286
  iconSide: "right",
287
+ isSelected: active,
287
288
  hasActiveFilters: active,
288
289
  numActiveFilters: active ? activeItemsCount : undefined,
289
290
  grow: true,
@@ -71,8 +71,10 @@ export var FieldValueToggleFilter = /*#__PURE__*/function (_Component) {
71
71
  };
72
72
  return ___EmotionJSX(EuiFilterButton, {
73
73
  onClick: onClick,
74
+ isSelected: hasActiveFilters,
74
75
  hasActiveFilters: hasActiveFilters,
75
- "aria-pressed": !!hasActiveFilters
76
+ "aria-pressed": !!hasActiveFilters,
77
+ isToggle: true
76
78
  }, name);
77
79
  }
78
80
  }]);
@@ -72,9 +72,11 @@ export var FieldValueToggleGroupFilter = /*#__PURE__*/function (_Component) {
72
72
  return ___EmotionJSX(EuiFilterButton, {
73
73
  key: key,
74
74
  onClick: onClick,
75
+ isSelected: active,
75
76
  hasActiveFilters: active,
76
77
  "aria-pressed": !!active,
77
- withNext: !isLastItem
78
+ withNext: !isLastItem,
79
+ isToggle: true
78
80
  }, name);
79
81
  });
80
82
  }
@@ -67,8 +67,10 @@ export var IsFilter = /*#__PURE__*/function (_Component) {
67
67
  };
68
68
  return ___EmotionJSX(EuiFilterButton, {
69
69
  onClick: onClick,
70
+ isSelected: hasActiveFilters,
70
71
  hasActiveFilters: hasActiveFilters,
71
- "aria-pressed": !!hasActiveFilters
72
+ "aria-pressed": !!hasActiveFilters,
73
+ isToggle: true
72
74
  }, name);
73
75
  }
74
76
  }]);
@@ -184,7 +184,7 @@ describe('EuiSearchBar', function () {
184
184
  cy.checkAxe();
185
185
  });
186
186
  it('has zero violations after filtering on Open items', function () {
187
- cy.get('button.euiButtonEmpty').first().focus();
187
+ cy.get('button.euiFilterButton').first().focus();
188
188
  cy.realPress('Enter');
189
189
  cy.get('table.euiTable tbody').find('tr').should('have.length', 3);
190
190
  cy.checkAxe();
@@ -195,12 +195,12 @@ describe('EuiSearchBar', function () {
195
195
  cy.checkAxe();
196
196
  });
197
197
  it('has zero violations after filtering by Tags', function () {
198
- cy.get('button.euiButtonEmpty').last().focus();
198
+ cy.get('button.euiFilterButton').last().focus();
199
199
  cy.realPress('Enter');
200
200
  cy.realPress('ArrowDown');
201
201
  cy.realPress('Enter');
202
202
  cy.realPress('Escape');
203
- cy.get('button.euiButtonEmpty').last().should('have.focus');
203
+ cy.get('button.euiFilterButton').last().should('have.focus');
204
204
  cy.get('table.euiTable tbody').find('tr').should('have.length', 3);
205
205
  cy.checkAxe();
206
206
  cy.repeatRealPress(['Shift', 'Tab'], 3);
@@ -1,6 +1,9 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
3
  import _extends from "@babel/runtime/helpers/extends";
3
4
  var _excluded = ["children", "align", "onSort", "isSorted", "isSortAscending", "className", "scope", "mobileOptions", "width", "style", "readOnly", "tooltipProps", "description", "append"];
5
+ 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; }
6
+ 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; }
4
7
  /*
5
8
  * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
6
9
  * or more contributor license agreements. Licensed under the Elastic License
@@ -16,7 +19,7 @@ import { EuiI18n } from '../i18n';
16
19
  import { EuiScreenReaderOnly } from '../accessibility';
17
20
  import { EuiIcon } from '../icon';
18
21
  import { EuiInnerText } from '../inner_text';
19
- import { EuiIconTip } from '../tool_tip';
22
+ import { EuiIconTip, EuiToolTip } from '../tool_tip';
20
23
  import { resolveWidthAsStyle } from './utils';
21
24
  import { useEuiTableIsResponsive } from './mobile/responsive_context';
22
25
  import { EuiTableCellContent } from './_table_cell_content';
@@ -31,6 +34,21 @@ var CellContents = function CellContents(_ref) {
31
34
  canSort = _ref.canSort,
32
35
  isSorted = _ref.isSorted,
33
36
  isSortAscending = _ref.isSortAscending;
37
+ var tooltipIcon = tooltipProps ? canSort ? ___EmotionJSX(EuiIcon, _extends({
38
+ className: "euiTableSortIcon",
39
+ type: tooltipProps.icon || 'questionInCircle',
40
+ size: "m",
41
+ color: "subdued"
42
+ }, tooltipProps.iconProps)) : ___EmotionJSX(EuiIconTip, _extends({
43
+ content: tooltipProps.content,
44
+ type: tooltipProps.icon || 'questionInCircle',
45
+ size: "m",
46
+ color: "subdued",
47
+ position: "top",
48
+ iconProps: _objectSpread({
49
+ role: 'button'
50
+ }, tooltipProps.iconProps)
51
+ }, tooltipProps.tooltipProps)) : null;
34
52
  return ___EmotionJSX(EuiTableCellContent, {
35
53
  className: className,
36
54
  align: align,
@@ -51,14 +69,7 @@ var CellContents = function CellContents(_ref) {
51
69
  className: "eui-textTruncate"
52
70
  }, children);
53
71
  });
54
- }), description && ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("span", null, description)), tooltipProps && ___EmotionJSX(EuiIconTip, _extends({
55
- content: tooltipProps.content,
56
- type: tooltipProps.icon || 'questionInCircle',
57
- size: "m",
58
- color: "subdued",
59
- position: "top",
60
- iconProps: tooltipProps.iconProps
61
- }, tooltipProps.tooltipProps)), isSorted ? ___EmotionJSX(EuiIcon, {
72
+ }), description && ___EmotionJSX(EuiScreenReaderOnly, null, ___EmotionJSX("span", null, description)), tooltipIcon, isSorted ? ___EmotionJSX(EuiIcon, {
62
73
  className: "euiTableSortIcon",
63
74
  type: isSortAscending ? 'sortUp' : 'sortDown',
64
75
  size: "m"
@@ -120,7 +131,11 @@ export var EuiTableHeaderCell = function EuiTableHeaderCell(_ref2) {
120
131
  role: "columnheader",
121
132
  "aria-sort": ariaSortValue,
122
133
  style: inlineStyles
123
- }, rest), canSort ? ___EmotionJSX("button", {
134
+ }, rest), canSort ? ___EmotionJSX(EuiToolTip, _extends({
135
+ content: tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.content
136
+ }, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.tooltipProps, {
137
+ display: "block"
138
+ }), ___EmotionJSX("button", {
124
139
  type: "button",
125
140
  css: styles.euiTableHeaderCell__button,
126
141
  className: classNames('euiTableHeaderButton', {
@@ -128,5 +143,5 @@ export var EuiTableHeaderCell = function EuiTableHeaderCell(_ref2) {
128
143
  }),
129
144
  onClick: onSort,
130
145
  "data-test-subj": "tableHeaderSortButton"
131
- }, ___EmotionJSX(CellContents, cellContentsProps)) : ___EmotionJSX(CellContents, cellContentsProps), append);
146
+ }, ___EmotionJSX(CellContents, cellContentsProps))) : ___EmotionJSX(CellContents, cellContentsProps), append);
132
147
  };
@@ -171,7 +171,10 @@ export var EuiToolTip = /*#__PURE__*/function (_Component) {
171
171
  });
172
172
  _defineProperty(_this, "onEscapeKey", function (event) {
173
173
  if (event.key === keys.ESCAPE) {
174
- if (_this.state.visible) event.stopPropagation();
174
+ // when the tooltip is only visual, we don't want it to add an additional key stop
175
+ if (!_this.props.disableScreenReaderOutput) {
176
+ if (_this.state.visible) event.stopPropagation();
177
+ }
175
178
  _this.setState({
176
179
  hasFocus: false
177
180
  }); // Allows mousing over back into the tooltip to work correctly