import type { CSSProperties, HTMLAttributes, ReactNode } from "react";
import { forwardRef } from "react";
import cn from "classnames";
import type { RenderConditionalPortalProps } from "@react-md/portal";
import { ConditionalPortal } from "@react-md/portal";
import type {
CSSTransitionClassNames,
CSSTransitionComponentProps,
TransitionTimeout,
} from "@react-md/transition";
import { useCSSTransition } from "@react-md/transition";
import type { SimplePosition } from "@react-md/utils";
import { bem } from "@react-md/utils";
import {
DEFAULT_TOOLTIP_CLASSNAMES,
DEFAULT_TOOLTIP_POSITION,
DEFAULT_TOOLTIP_TIMEOUT,
} from "./constants";
/**
* The base props for the `Tooltip` component. This can be extended when
* creating custom tooltip implementations.
*
* @remarks \@since 2.8.0 Supports the {@link RenderConditionalPortalProps}
*/
export interface TooltipProps
extends HTMLAttributes,
RenderConditionalPortalProps,
CSSTransitionComponentProps {
/**
* An id for the tooltip. This is required for accessibility and finding an
* element to attach event listeners to show and hide the tooltip.
*/
id: string;
/**
* An optional style to apply to the tooltip.
*/
style?: CSSProperties;
/**
* An optional class name to apply to the tooltip.
*/
className?: string;
/**
* The contents of the tooltip to display. This can be any renderable element,
* but this is normally just text.
*
* If this is placed within a `