matrix-react-sdk
Version:
SDK for matrix.org using React
41 lines (40 loc) • 1.24 kB
TypeScript
import React, { CSSProperties } from "react";
export declare enum Alignment {
Natural = 0,// Pick left or right
Left = 1,
Right = 2,
Top = 3,// Centered
Bottom = 4,// Centered
InnerBottom = 5,// Inside the target, at the bottom
TopRight = 6
}
export interface ITooltipProps {
className?: string;
tooltipClassName?: string;
visible?: boolean;
label: React.ReactNode;
alignment?: Alignment;
id?: string;
maxParentWidth?: number;
role?: React.AriaRole;
}
type State = Partial<Pick<CSSProperties, "display" | "right" | "top" | "transform" | "left">>;
/**
* @deprecated Use [compound tooltip](https://element-hq.github.io/compound-web/?path=/docs/tooltip--docs) instead
*/
export default class Tooltip extends React.PureComponent<ITooltipProps, State> {
private static container;
private parent;
static readonly Alignment: typeof Alignment;
static readonly defaultProps: {
visible: boolean;
alignment: Alignment;
};
constructor(props: ITooltipProps);
componentDidMount(): void;
componentDidUpdate(prevProps: ITooltipProps): void;
componentWillUnmount(): void;
private updatePosition;
render(): React.ReactNode;
}
export {};