import * as React from "react"; import type { StyleType } from "@khanacademy/wonder-blocks-core"; import type { State as PopperState } from "@popperjs/core"; import type { CSSProperties } from "aphrodite"; export type getRefFn = (arg1?: React.Component | Element | null | undefined) => void; export type Offset = { bottom: CSSProperties["bottom"]; top: CSSProperties["top"]; left: CSSProperties["left"]; right: CSSProperties["right"]; transform: CSSProperties["transform"]; }; export type Placement = "top" | "bottom" | "right" | "left"; /** * The visual style of the tooltip. * * - `subtle`: the default, standard tooltip styling. * - `strong`: a higher-emphasis tooltip that uses an inverse/knockout * treatment. Its colors are defined with semantic tokens, so they adapt to * the active theme. */ export type TooltipVariant = "subtle" | "strong"; /** * Subset of CSS properties to allow overriding some of the default styles */ export type ContentStyle = { color?: CSSProperties["color"]; padding?: CSSProperties["padding"]; }; export type PopperUpdateFn = () => Promise>; export type PopperElementProps = { /** The placement of the bubble with respect to the anchor. */ placement: Placement; /** Whether the bubble is out of bounds or not. */ isReferenceHidden?: boolean | null | undefined; /** A callback for updating the ref of the bubble itself. */ updateBubbleRef?: getRefFn; /** A callback for updating the ref of the bubble's tail. */ updateTailRef?: getRefFn; /** Where the tail is to be rendered. */ tailOffset?: Offset; /** Additional styles to be applied by the bubble. */ style?: StyleType; /** A callback to update the popper. */ update?: PopperUpdateFn; };