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.
7 changes: 7 additions & 0 deletions packages/eui/changelogs/upcoming/8736.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- Updated `EuiResizableCollapseButton` to use an empty button

**Bug fixes**

- Fixed visual positioning issue for notifications in `EuiHeaderSectionItemButton`
- Fixed a visual issue where `EuiCollabsibleNavItem` did not have a visible selected state

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import { css } from '@emotion/react';

import { UseEuiTheme } from '../../../services';
import { isEuiThemeRefreshVariant, UseEuiTheme } from '../../../services';
import {
logicalCSS,
mathWithUnits,
Expand All @@ -23,6 +23,10 @@ export const euiCollapsibleNavItemVariables = (
euiThemeContext: UseEuiTheme
) => {
const { euiTheme } = euiThemeContext;
const isRefreshVariant = isEuiThemeRefreshVariant(
euiThemeContext,
'buttonVariant'
);

return {
height: euiTheme.size.xl,
Expand All @@ -31,8 +35,9 @@ export const euiCollapsibleNavItemVariables = (
animation: `${euiTheme.animation.normal} ease-in-out`, // Matches EuiButton
borderRadius: euiTheme.border.radius.small,
backgroundHoverColor: euiTheme.colors.lightestShade,
backgroundSelectedColor: euiButtonColor(euiThemeContext, 'text')
.backgroundColor,
backgroundSelectedColor: isRefreshVariant
? euiTheme.colors.backgroundBaseInteractiveSelect
: euiButtonColor(euiThemeContext, 'text').backgroundColor,
color: euiTheme.colors.textParagraph,
rightIconColor: euiTheme.colors.textDisabled,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import { css } from '@emotion/react';

import { UseEuiTheme } from '../../../services';
import { isEuiThemeRefreshVariant, UseEuiTheme } from '../../../services';
import {
logicalCSS,
logicalSizeCSS,
Expand All @@ -23,12 +23,25 @@ export const euiHeaderSectionItemButtonStyles = (
) => {
const { childHeight } = euiHeaderVariables(euiThemeContext);
const { euiTheme } = euiThemeContext;
const isRefreshVariant = isEuiThemeRefreshVariant(
euiThemeContext,
'buttonVariant'
);

const dotSize = euiTheme.size.base;
const dotOffset = isRefreshVariant
? mathWithUnits(dotSize, (x) => x * -0.5)
: 0;
const badgeOffset = isRefreshVariant
? mathWithUnits(euiTheme.size.s, (x) => x * -0.5)
: '9%';

return {
euiHeaderSectionItemButton: css`
position: relative; /* For positioning the notification */
${logicalCSS('height', childHeight)}
${logicalCSS('min-width', childHeight)}
${logicalCSS('padding-horizontal', euiTheme.size.s)}
text-align: center;
font-size: 0; /* Aligns icons better vertically */

Expand All @@ -49,17 +62,17 @@ export const euiHeaderSectionItemButtonStyles = (
`,
dot: css`
${logicalCSS('top', 0)}
${logicalCSS('right', 0)}
${logicalCSS('right', dotOffset)}
stroke: ${euiTheme.colors.emptyShade};

${euiMaxBreakpoint(euiThemeContext, 's')} {
${logicalSizeCSS(euiTheme.size.base)}
${logicalSizeCSS(dotSize)}
${logicalCSS('top', '9%')}
}
`,
badge: css`
${logicalCSS('top', '9%')}
${logicalCSS('right', '9%')}
${logicalCSS('right', badgeOffset)}
box-shadow: 0 0 0 ${euiTheme.border.width.thin} ${euiTheme.colors
.emptyShade};
`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ exports[`EuiResizableContainer can have toggleable panels 1`] = `
>
<button
aria-label="Press to toggle this panel"
class="euiButtonIcon euiResizableCollapseButton emotion-euiButtonIcon-xs-base-text-euiResizableCollapseButton-euiScreenReaderOnly-showOnFocus-collapsible-before-middle"
class="euiButtonIcon euiResizableCollapseButton emotion-euiButtonIcon-xs-empty-text-euiResizableCollapseButton-euiScreenReaderOnly-showOnFocus-collapsible-before-middle"
type="button"
>
<span
Expand Down Expand Up @@ -325,7 +325,7 @@ exports[`EuiResizableContainer toggleable panels can be configurable 1`] = `
>
<button
aria-label="Press to toggle this panel"
class="euiButtonIcon euiResizableCollapseButton emotion-euiButtonIcon-xs-base-text-euiResizableCollapseButton-euiScreenReaderOnly-showOnFocus-collapsible-before-top"
class="euiButtonIcon euiResizableCollapseButton emotion-euiButtonIcon-xs-empty-text-euiResizableCollapseButton-euiScreenReaderOnly-showOnFocus-collapsible-before-top"
data-test-subj="panel-toggle"
type="button"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@
import React, { FunctionComponent } from 'react';
import classNames from 'classnames';

import { useEuiMemoizedStyles } from '../../services';
import {
useEuiMemoizedStyles,
useEuiThemeRefreshVariant,
} from '../../services';
import { EuiButtonIcon, EuiButtonIconPropsForButton } from '../button';
import { euiScreenReaderOnlyStyles } from '../accessibility/screen_reader_only/screen_reader_only.styles';

Expand Down Expand Up @@ -53,6 +56,7 @@ export const EuiResizableCollapseButton: FunctionComponent<
const isHorizontal = direction === 'horizontal';
const showOnFocus = !isCollapsed && !isVisible;

const isRefreshVariant = useEuiThemeRefreshVariant('buttonVariant');
const styles = useEuiMemoizedStyles(euiResizableCollapseButtonStyles);

const collapsedStyles = [
Expand Down Expand Up @@ -89,7 +93,7 @@ export const EuiResizableCollapseButton: FunctionComponent<

return (
<EuiButtonIcon
display={isCollapsed ? 'empty' : 'base'}
display={isRefreshVariant ? 'empty' : isCollapsed ? 'empty' : 'base'}
color="text"
className={classes}
css={cssStyles}
Expand Down