Files
NapCatQQ/.pnpm-store/v3/files/24/62410f3767f6875a303e6f21bd1260382f652cf6d938ca8ce9c39c5bf68bfe5ba754843500cf2e202f047ba1c41a9ff66a0576860f237722a28790225235c6
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

94 lines
3.3 KiB
Plaintext

import * as _heroui_aria_utils from '@heroui/aria-utils';
import { OverlayOptions } from '@heroui/aria-utils';
import * as react from 'react';
import { ReactNode } from 'react';
import * as _heroui_system from '@heroui/system';
import { PropGetter, HTMLHeroUIProps } from '@heroui/system';
import { PopoverVariantProps, SlotsToClasses } from '@heroui/theme';
import { AriaTooltipProps } from '@react-types/tooltip';
import { OverlayTriggerProps } from '@react-types/overlays';
import { HTMLMotionProps } from 'framer-motion';
import { AriaOverlayProps } from '@react-aria/overlays';
import { ReactRef } from '@heroui/react-utils';
interface Props extends Omit<HTMLHeroUIProps, "content"> {
/**
* Ref to the DOM node.
*/
ref?: ReactRef<HTMLElement | null>;
/**
* The children to render. Usually a trigger element.
*/
children?: ReactNode;
/**
* The content of the tooltip.
*/
content?: string | React.ReactNode;
/**
* Whether the tooltip should be disabled, independent from the trigger.
*/
isDisabled?: boolean;
/**
* The delay time in ms for the tooltip to show up.
* @default 0
*/
delay?: number;
/**
* The delay time in ms for the tooltip to hide.
* @default 500
*/
closeDelay?: number;
/**
* By default, opens for both focus and hover. Can be made to open only for focus.
*/
trigger?: "focus";
/**
* The props to modify the framer motion animation. Use the `variants` API to create your own animation.
*/
motionProps?: HTMLMotionProps<"div">;
/**
* The container element in which the overlay portal will be placed.
* @default document.body
*/
portalContainer?: Element;
/**
* List of dependencies to update the position of the tooltip.
* @default []
*/
updatePositionDeps?: any[];
/**
* Classname or List of classes to change the classNames of the element.
* if `className` is passed, it will be added to the base slot.
*
* @example
* ```ts
* <Tooltip classNames={{
* base:"base-classes",
* content: "content-classes",
* arrow: "arrow-classes",
* }} />
* ```
*/
classNames?: SlotsToClasses<"base" | "arrow" | "content">;
}
type UseTooltipProps = Props & AriaTooltipProps & AriaOverlayProps & OverlayTriggerProps & OverlayOptions & PopoverVariantProps;
declare function useTooltip(originalProps: UseTooltipProps): {
Component: _heroui_system.As<any>;
content: ReactNode;
children: ReactNode;
isOpen: boolean;
triggerRef: react.RefObject<HTMLElement>;
showArrow: boolean;
portalContainer: Element | undefined;
placement: _heroui_aria_utils.OverlayPlacement;
disableAnimation: boolean;
isDisabled: boolean | undefined;
motionProps: HTMLMotionProps<"div"> | undefined;
getTooltipContentProps: PropGetter<Record<string, unknown>, _heroui_system.DOMAttributes<_heroui_system.DOMElement>>;
getTriggerProps: PropGetter<Record<string, unknown>, _heroui_system.DOMAttributes<_heroui_system.DOMElement>>;
getTooltipProps: PropGetter<Record<string, unknown>, _heroui_system.DOMAttributes<_heroui_system.DOMElement>>;
};
type UseTooltipReturn = ReturnType<typeof useTooltip>;
export { UseTooltipProps, UseTooltipReturn, useTooltip };