"use client";
import { jsx as _jsx } from "react/jsx-runtime";
import { createContext, useContext } from "react";
import { createHoverModeContext, useHoverModeProvider } from "../hoverMode/useHoverModeProvider.js";
import { DEFAULT_TOOLTIP_DELAY } from "./constants.js";
const context = /*#__PURE__*/ createContext(createHoverModeContext({
    hoverTimeout: DEFAULT_TOOLTIP_DELAY,
    leaveTimeout: 0
}));
context.displayName = "TooltipHoverMode";
const { Provider } = context;
/**
 * @internal
 * @since 6.0.0
 */ export function useTooltipHoverMode() {
    return useContext(context);
}
/**
 * **Client Component**
 *
 * Updates all tooltips that are rendered as a child anywhere in the React tree
 * to immediately appear for a short duration once a tooltip has become visible.
 * You can also use this provider to configure all tooltips' visibility delay to
 * a new value.
 *
 * @example Configuration Example
 * ```tsx
 * <TooltipHoverModeProvider
 *   // wait 3 seconds before displaying any tooltips
 *   hoverTimeout={3000}
 *
 *   // wait 1 second before hiding any tooltips
 *   leaveTimeout={1000}
 *
 *   // disable the hover mode functionality only if another tooltip has not
 *   // been visible for 20 seconds
 *   disableTimeout={20000}
 * >
 *   <RestOfTheApp />
 * </TooltipHoverModeProvider>
 * ```
 *
 * @since 6.0.0
 */ export function TooltipHoverModeProvider(props) {
    const { hoverTimeout = DEFAULT_TOOLTIP_DELAY, leaveTimeout = 0, disableTimeout = DEFAULT_TOOLTIP_DELAY, defaultActiveId, children } = props;
    const context = useHoverModeProvider({
        hoverTimeout,
        leaveTimeout,
        disableTimeout,
        defaultActiveId
    });
    return /*#__PURE__*/ _jsx(Provider, {
        value: context,
        children: children
    });
}

//# sourceMappingURL=TooltipHoverModeProvider.js.map