@grafana/ui
Version:
Grafana Components Library
43 lines (42 loc) • 1.48 kB
TypeScript
import { PropsWithChildren } from 'react';
import * as React from 'react';
import { IconName } from '../../types/icon';
interface BaseProps {
/** @deprecated no longer used */
icon?: IconName;
/** @deprecated no longer used */
iconTooltip?: string;
className?: string;
contentClassName?: string;
closeOnEscape?: boolean;
closeOnBackdropClick?: boolean;
trapFocus?: boolean;
isOpen?: boolean;
onDismiss?: () => void;
/** If not set will call onDismiss if that is set. */
onClickBackdrop?: () => void;
}
interface WithStringTitleProps extends BaseProps {
/** Title for the modal or custom header element */
title: string;
ariaLabel?: never;
}
interface WithCustomTitleProps extends BaseProps {
/** Title for the modal or custom header element */
title: JSX.Element;
/** aria-label for the dialog. only needed when passing a custom title element */
ariaLabel: string;
}
export type Props = WithStringTitleProps | WithCustomTitleProps;
/**
* https://developers.grafana.com/ui/latest/index.html?path=/docs/overlays-modal--docs
*/
export declare function Modal(props: PropsWithChildren<Props>): import("react/jsx-runtime").JSX.Element | null;
export declare namespace Modal {
var ButtonRow: typeof ModalButtonRow;
}
declare function ModalButtonRow({ leftItems, children }: {
leftItems?: React.ReactNode;
children: React.ReactNode;
}): import("react/jsx-runtime").JSX.Element;
export {};