Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions packages/eui/changelogs/upcoming/8670.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Updated `EuiDataGridToolbarControl` hover styles by removing text-decoration and changing the badge background-color to ensure enough contrast

Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ exports[`EuiDataGrid rendering renders additional toolbar controls 1`] = `
data-test-subj="dataGridColumnSelectorPopover"
>
<button
class="euiButtonEmpty euiDataGridToolbarControl emotion-euiButtonDisplay-euiButtonEmpty-xs-empty-text-underlineStyles"
class="euiButtonEmpty euiDataGridToolbarControl emotion-euiButtonDisplay-euiButtonEmpty-xs-empty-text-interactiveStyles"
data-test-subj="dataGridColumnSelectorButton"
type="button"
>
Expand Down Expand Up @@ -908,7 +908,7 @@ exports[`EuiDataGrid rendering renders control columns 1`] = `
data-test-subj="dataGridColumnSelectorPopover"
>
<button
class="euiButtonEmpty euiDataGridToolbarControl emotion-euiButtonDisplay-euiButtonEmpty-xs-empty-text-underlineStyles"
class="euiButtonEmpty euiDataGridToolbarControl emotion-euiButtonDisplay-euiButtonEmpty-xs-empty-text-interactiveStyles"
data-test-subj="dataGridColumnSelectorButton"
type="button"
>
Expand Down Expand Up @@ -1541,7 +1541,7 @@ exports[`EuiDataGrid rendering renders custom column headers 1`] = `
data-test-subj="dataGridColumnSelectorPopover"
>
<button
class="euiButtonEmpty euiDataGridToolbarControl emotion-euiButtonDisplay-euiButtonEmpty-xs-empty-text-underlineStyles"
class="euiButtonEmpty euiDataGridToolbarControl emotion-euiButtonDisplay-euiButtonEmpty-xs-empty-text-interactiveStyles"
data-test-subj="dataGridColumnSelectorButton"
type="button"
>
Expand Down Expand Up @@ -1973,7 +1973,7 @@ exports[`EuiDataGrid rendering renders with common and div attributes 1`] = `
data-test-subj="dataGridColumnSelectorPopover"
>
<button
class="euiButtonEmpty euiDataGridToolbarControl emotion-euiButtonDisplay-euiButtonEmpty-xs-empty-text-underlineStyles"
class="euiButtonEmpty euiDataGridToolbarControl emotion-euiButtonDisplay-euiButtonEmpty-xs-empty-text-interactiveStyles"
data-test-subj="dataGridColumnSelectorButton"
type="button"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports[`useDataGridColumnSelector columnSelector renders a toolbar button/popov
data-test-subj="dataGridColumnSelectorPopover"
>
<button
class="euiButtonEmpty euiDataGridToolbarControl emotion-euiButtonDisplay-euiButtonEmpty-xs-empty-text-underlineStyles"
class="euiButtonEmpty euiDataGridToolbarControl emotion-euiButtonDisplay-euiButtonEmpty-xs-empty-text-interactiveStyles"
data-test-subj="dataGridColumnSelectorButton"
type="button"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ exports[`DataGridSortingControl renders a toolbar button/popover allowing users
data-test-subj="dataGridColumnSortingPopover"
>
<button
class="euiButtonEmpty euiDataGridToolbarControl emotion-euiButtonDisplay-euiButtonEmpty-xs-empty-text-underlineStyles"
class="euiButtonEmpty euiDataGridToolbarControl emotion-euiButtonDisplay-euiButtonEmpty-xs-empty-text-interactiveStyles"
data-test-subj="dataGridColumnSortingButton"
type="button"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`euiDataGridToolbarControl passes props to the underlying EuiButtonEmpty 1`] = `
<button
aria-label="aria-label"
class="euiButtonEmpty euiDataGridToolbarControl testClass1 testClass2 emotion-euiButtonDisplay-euiButtonEmpty-xs-empty-text-underlineStyles-euiTestCss"
class="euiButtonEmpty euiDataGridToolbarControl testClass1 testClass2 emotion-euiButtonDisplay-euiButtonEmpty-xs-empty-text-interactiveStyles-euiTestCss"
data-test-subj="test subject string"
type="button"
>
Expand All @@ -25,7 +25,7 @@ exports[`euiDataGridToolbarControl passes props to the underlying EuiButtonEmpty

exports[`euiDataGridToolbarControl renders with a badge 1`] = `
<button
class="euiButtonEmpty euiDataGridToolbarControl emotion-euiButtonDisplay-euiButtonEmpty-xs-empty-text-underlineStyles"
class="euiButtonEmpty euiDataGridToolbarControl emotion-euiButtonDisplay-euiButtonEmpty-xs-empty-text-interactiveStyles"
type="button"
>
<span
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
import React, { FunctionComponent } from 'react';
import classNames from 'classnames';
import { css } from '@emotion/react';
import { UseEuiTheme } from '@elastic/eui-theme-common';

import { useEuiTheme, useEuiThemeRefreshVariant } from '../../../services';
import { EuiButtonEmpty, EuiButtonEmptyProps } from '../../button';
import { EuiNotificationBadge } from '../../badge';
import { useEuiI18n } from '../../i18n';
Expand All @@ -21,8 +23,15 @@ export type EuiDataGridToolbarControlProps = EuiButtonEmptyProps & {
export const EuiDataGridToolbarControl: FunctionComponent<
EuiDataGridToolbarControlProps
> = ({ children, className, badgeContent, textProps, ...rest }) => {
const euiThemeContext = useEuiTheme();
const isRefreshVariant = useEuiThemeRefreshVariant('buttonVariant');
const classes = classNames('euiDataGridToolbarControl', className);

const cssStyles = isRefreshVariant
? // passes euiThemeContext here instead via `css` to ensure legacy Enzyme tests work
interactiveStyles(euiThemeContext)
: underlineStyles;

const badgeAriaLabel = useEuiI18n(
'euiDataGridToolbarControl.badgeAriaLabel',
'Active: {count}',
Expand All @@ -40,7 +49,7 @@ export const EuiDataGridToolbarControl: FunctionComponent<
size="xs"
color="text"
textProps={false}
css={underlineStyles}
css={cssStyles}
{...rest}
>
<span
Expand Down Expand Up @@ -85,6 +94,16 @@ const underlineStyles = css`
}
}
`;

const interactiveStyles = ({ euiTheme }: UseEuiTheme) => css`
&:focus,
&:hover:not(:disabled) {
.euiDataGridToolbarControl__badge {
background-color: ${euiTheme.components.filterButtonBadgeBackgroundHover};
}
}
`;

const badgeStyles = css`
cursor: inherit;
`;