import { type ReactElement, type ReactNode } from 'react'; import * as React from 'react'; import { LoadingState } from '@grafana/data'; import { type PanelStatusItem } from './types'; /** * @internal */ export type PanelChromeProps = (AutoSize | FixedDimensions) & (Collapsible | HoverHeader); interface BaseProps { padding?: PanelPadding; title?: string | React.ReactElement; /** Shown in info icon tooltip next to the title, supports simple html markup */ description?: string | (() => string); /** Shown in as text below the title, supports simple html markup */ subtitle?: string | (() => string); titleItems?: ReactNode; menu?: ReactElement | (() => ReactElement); dragClass?: string; dragClassCancel?: string; onDragStart?: (e: React.PointerEvent) => void; selectionId?: string; /** * Use only to indicate loading or streaming data in the panel. * Any other values of loadingState are ignored. */ loadingState?: LoadingState; /** * Used to display status message (used for panel errors currently) */ statusMessage?: string; /** * Structured list of errors and notices shown in the panel header status popover. */ statusItems?: PanelStatusItem[]; /** * Fired when the user clicks the status message/popover, alongside PanelContext's * `onOpenInspector` which actually opens the error details view. Use for host-side side * effects (e.g. telemetry). */ statusMessageOnClick?: (e: React.SyntheticEvent) => void; /** * @deprecated use `actions' instead **/ leftItems?: ReactNode[]; actions?: ReactNode; displayMode?: 'default' | 'transparent'; onCancelQuery?: () => void; /** * callback when opening the panel menu */ onOpenMenu?: () => void; /** * Used for setting panel attention */ onFocus?: () => void; /** * Debounce the event handler, if possible */ onMouseMove?: () => void; onMouseEnter?: () => void; /** * If true, the VizPanelMenu will always be visible in the panel header. Defaults to false. */ showMenuAlways?: boolean; /** * Content to display in the sub-header area below the main header. * Can contain text, pills, links, buttons, or any other React elements. */ subHeaderContent?: ReactNode; /** * Minimum height (px) for the panel container. Used by content-fit layouts so * the chrome still fills a floor when its content is shorter. */ minHeight?: number; } interface FixedDimensions extends BaseProps { width: number; height: number; children: (innerWidth: number, innerHeight: number) => ReactNode; } interface AutoSize extends BaseProps { width?: never; height?: never; children: ReactNode; } interface Collapsible { collapsible: boolean; collapsed?: boolean; /** * callback when collapsing or expanding the panel */ onToggleCollapse?: (collapsed: boolean) => void; hoverHeader?: never; hoverHeaderOffset?: never; } interface HoverHeader { collapsible?: never; collapsed?: never; showMenuAlways?: never; onToggleCollapse?: never; hoverHeader?: boolean; hoverHeaderOffset?: number; } /** * @internal */ export type PanelPadding = 'none' | 'md'; /** * Component used for rendering content wrapped in the same style as grafana panels. * * https://developers.grafana.com/ui/latest/index.html?path=/docs/plugins-panelchrome--docs * * @internal */ export declare function PanelChrome({ width, height, children, padding, title, description, displayMode, titleItems, menu, dragClass, dragClassCancel, hoverHeader, hoverHeaderOffset, loadingState, statusMessage, statusItems, statusMessageOnClick, leftItems, actions, selectionId, onCancelQuery, onOpenMenu, collapsible, collapsed, onToggleCollapse, onFocus, onMouseMove, onMouseEnter, onDragStart, showMenuAlways, subHeaderContent, subtitle, minHeight, }: PanelChromeProps): React.JSX.Element; export {};