import type { CSSProperties, ReactElement, ReactNode } from "react"; import type { RenderConditionalPortalProps } from "@react-md/portal"; import type { TooltipProps } from "./Tooltip"; import type { TooltippedElementEventHandlers, BaseTooltipHookOptions } from "./useTooltip"; interface TooltippedProvidedProps extends TooltippedElementEventHandlers { id: string; "aria-describedby"?: string; tooltip: ReactNode; } export declare type ChildrenRenderer = (props: TooltippedProvidedProps) => ReactElement; declare type ChildProps = Partial>; declare type ChildElement = ReactElement; export interface TooltippedProps extends RenderConditionalPortalProps, BaseTooltipHookOptions, Pick { /** * The id for the element that has a tooltip. This is always required since it * will be passed down to the `containerProps` in the children renderer * function. It is also used to generate a `tooltipId` when there is a * tooltip. */ id: string; /** * The tooltip to display. When this is false-ish, the children renderer will * always return `null` for the `tooltip` prop. */ tooltip?: ReactNode; /** * An optional additional `aria-describedby` id or ids to merge with the * tooltip id. This is really used for things like notifications or when * multiple elements describe your tooltipped element. */ "aria-describedby"?: string; /** * An optional style for the tooltip. */ style?: CSSProperties; /** * An optional className for the tooltip */ className?: string; /** * The children for this component should either be a function or a single * element. When the children is a single React element, this component will * clone in an `id`, `aria-describedby`, and all the event handlers required * to show and hide a tooltip relative to that element. This means that you * will need to ensure that the child component accepts and passes down the * `on*` event handlers to a DOM node as well as the `id` and * `aria-describedby` for accessibility. Every component within react-md * should do this by default. * * If the children is a function, the `id`, `aria-describedby`, and event * handlers will be provided as well as a new `tooltip` prop so that you have * more control over rendering the tooltip. * * If the tooltip prop was not provided to this component, the * `aria-describedby` and the event handlers will be omitted. */ children: ChildElement | ChildrenRenderer; } /** * The `Tooltipped` component can be used to dynamically add a tooltip to child * element by cloning the required event handlers and accessibility props into * the child with `React.cloneChild`. * * Note: This component is _kind of_ deprecated in favor of using the * `useTooltip` hook and `Tooltip` component instead. * * @see {@link Tooltip} for an example */ export declare function Tooltipped({ id, style, children, tooltip: tooltipChildren, dense, vhMargin, vwMargin, spacing, denseSpacing, position: propPosition, threshold, onClick, onMouseEnter, onMouseLeave, onTouchStart, onContextMenu, onBlur, onFocus, onKeyDown, "aria-describedby": describedBy, defaultPosition, temporary, disableSwapping, disableHoverMode, disableAutoSpacing, ...props }: TooltippedProps): ReactElement; export {};