+ {statusMessage && (
+
+ )}
+
{headerContent}
@@ -175,15 +171,6 @@ export function PanelChrome({
)}
- {statusMessage && (
-
- )}
-
{children(innerWidth, innerHeight)}
@@ -245,6 +232,7 @@ const getStyles = (theme: GrafanaTheme2) => {
visibility: 'hidden',
opacity: '0',
},
+
'&:focus-visible, &:hover': {
// only show menu icon on hover or focused panel
'.show-on-hover': {
@@ -256,8 +244,7 @@ const getStyles = (theme: GrafanaTheme2) => {
'&:focus-visible': {
outline: `1px solid ${theme.colors.action.focus}`,
},
- }),
- regularHeader: css({
+
'&:focus-within': {
'.show-on-hover': {
visibility: 'visible',
@@ -281,7 +268,6 @@ const getStyles = (theme: GrafanaTheme2) => {
label: 'panel-header',
display: 'flex',
alignItems: 'center',
- padding: theme.spacing(0, 0, 0, padding),
}),
streaming: css({
label: 'panel-streaming',
@@ -295,7 +281,7 @@ const getStyles = (theme: GrafanaTheme2) => {
title: css({
label: 'panel-title',
marginBottom: 0, // override default h6 margin-bottom
- paddingRight: theme.spacing(1),
+ padding: theme.spacing(0, padding),
textOverflow: 'ellipsis',
overflow: 'hidden',
whiteSpace: 'nowrap',
@@ -316,14 +302,11 @@ const getStyles = (theme: GrafanaTheme2) => {
visibility: 'hidden',
border: 'none',
}),
- errorContainer: css({
+ errorContainerFloating: css({
label: 'error-container',
position: 'absolute',
- left: '50%',
- transform: 'translateX(-50%)',
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'center',
+ left: 0,
+ top: 0,
zIndex: theme.zIndex.tooltip,
}),
leftItems: css({
diff --git a/packages/grafana-ui/src/components/PanelChrome/PanelStatus.tsx b/packages/grafana-ui/src/components/PanelChrome/PanelStatus.tsx
index 55fd516f6ba..7e83298fd3a 100644
--- a/packages/grafana-ui/src/components/PanelChrome/PanelStatus.tsx
+++ b/packages/grafana-ui/src/components/PanelChrome/PanelStatus.tsx
@@ -1,4 +1,4 @@
-import { cx, css } from '@emotion/css';
+import { css } from '@emotion/css';
import React from 'react';
import { GrafanaTheme2 } from '@grafana/data';
@@ -7,18 +7,17 @@ import { useStyles2 } from '../../themes';
import { ToolbarButton } from '../ToolbarButton/ToolbarButton';
export interface Props {
- className?: string;
message?: string;
onClick?: (e: React.SyntheticEvent) => void;
ariaLabel?: string;
}
-export function PanelStatus({ className, message, onClick, ariaLabel = 'status' }: Props) {
+export function PanelStatus({ message, onClick, ariaLabel = 'status' }: Props) {
const styles = useStyles2(getStyles);
return (
{
}),
timeshift: css({
color: theme.colors.text.link,
+ gap: theme.spacing(0.5),
'&:hover': {
color: theme.colors.emphasize(theme.colors.text.link, 0.03),
diff --git a/public/app/features/dashboard/dashgrid/PanelStateWrapper.tsx b/public/app/features/dashboard/dashgrid/PanelStateWrapper.tsx
index 6e2c72fc71a..b6648bfc838 100644
--- a/public/app/features/dashboard/dashgrid/PanelStateWrapper.tsx
+++ b/public/app/features/dashboard/dashgrid/PanelStateWrapper.tsx
@@ -631,12 +631,13 @@ export class PanelStateWrapper extends PureComponent {
const { transparent } = panel;
const alertState = data.alertState?.state;
+ const hasHoverHeader = this.hasOverlayHeader();
const containerClassNames = classNames({
'panel-container': true,
'panel-container--absolute': isSoloRoute(locationService.getLocation().pathname),
'panel-container--transparent': transparent,
- 'panel-container--no-title': this.hasOverlayHeader(),
+ 'panel-container--no-title': hasHoverHeader,
[`panel-alert-state--${alertState}`]: alertState !== undefined,
});
@@ -648,6 +649,7 @@ export class PanelStateWrapper extends PureComponent {
(data.series.length > 0 && data.series.some((v) => (v.meta?.notices?.length ?? 0) > 0)) ||
(data.request && data.request.timeInfo) ||
alertState;
+
const titleItems = showTitleItems && (
{
dragClassCancel="grid-drag-cancel"
padding={padding}
hoverHeaderOffset={hoverHeaderOffset}
- hoverHeader={title ? false : true}
+ hoverHeader={this.hasOverlayHeader()}
displayMode={transparent ? 'transparent' : 'default'}
>
{(innerWidth, innerHeight) => (