@huin-core/react-tooltip 1.0.1 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.d.mts +100 -0
- package/dist/index.d.ts +100 -0
- package/dist/index.js +579 -0
- package/dist/index.js.map +7 -0
- package/dist/index.mjs +547 -0
- package/dist/index.mjs.map +7 -0
- package/package.json +13 -13
package/dist/index.d.mts
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
import * as React$1 from 'react';
|
2
|
+
import React__default from 'react';
|
3
|
+
import { Portal } from '@huin-core/react-portal';
|
4
|
+
import * as PopperPrimitive from '@huin-core/react-popper';
|
5
|
+
import { DismissableLayer } from '@huin-core/react-dismissable-layer';
|
6
|
+
import { Primitive } from '@huin-core/react-primitive';
|
7
|
+
|
8
|
+
type PrimitiveButtonProps = React__default.ComponentPropsWithoutRef<typeof Primitive.button>;
|
9
|
+
interface TooltipTriggerProps extends PrimitiveButtonProps {
|
10
|
+
}
|
11
|
+
declare const TooltipTrigger: React__default.ForwardRefExoticComponent<TooltipTriggerProps & React__default.RefAttributes<HTMLButtonElement>>;
|
12
|
+
|
13
|
+
interface TooltipProps {
|
14
|
+
children?: React$1.ReactNode;
|
15
|
+
open?: boolean;
|
16
|
+
defaultOpen?: boolean;
|
17
|
+
onOpenChange?: (open: boolean) => void;
|
18
|
+
/**
|
19
|
+
* The duration from when the pointer enters the trigger until the tooltip gets opened. This will
|
20
|
+
* override the prop with the same name passed to Provider.
|
21
|
+
* @defaultValue 700
|
22
|
+
*/
|
23
|
+
delayDuration?: number;
|
24
|
+
/**
|
25
|
+
* When `true`, trying to hover the content will result in the tooltip closing as the pointer leaves the trigger.
|
26
|
+
* @defaultValue false
|
27
|
+
*/
|
28
|
+
disableHoverableContent?: boolean;
|
29
|
+
}
|
30
|
+
declare const Tooltip: React$1.FC<TooltipProps>;
|
31
|
+
declare const Root: React$1.FC<TooltipProps>;
|
32
|
+
|
33
|
+
type PortalProps = React.ComponentPropsWithoutRef<typeof Portal>;
|
34
|
+
interface TooltipPortalProps {
|
35
|
+
children?: React.ReactNode;
|
36
|
+
/**
|
37
|
+
* Specify a container element to portal the content into.
|
38
|
+
*/
|
39
|
+
container?: PortalProps["container"];
|
40
|
+
/**
|
41
|
+
* Used to force mounting when more control is needed. Useful when
|
42
|
+
* controlling animation with React animation libraries.
|
43
|
+
*/
|
44
|
+
forceMount?: true;
|
45
|
+
}
|
46
|
+
declare const TooltipPortal: React.FC<TooltipPortalProps>;
|
47
|
+
|
48
|
+
interface TooltipContentProps extends TooltipContentImplProps {
|
49
|
+
/**
|
50
|
+
* Used to force mounting when more control is needed. Useful when
|
51
|
+
* controlling animation with React animation libraries.
|
52
|
+
*/
|
53
|
+
forceMount?: true;
|
54
|
+
}
|
55
|
+
declare const TooltipContent: React__default.ForwardRefExoticComponent<TooltipContentProps & React__default.RefAttributes<HTMLDivElement>>;
|
56
|
+
type DismissableLayerProps = React__default.ComponentPropsWithoutRef<typeof DismissableLayer>;
|
57
|
+
type PopperContentProps = React__default.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;
|
58
|
+
interface TooltipContentImplProps extends Omit<PopperContentProps, "onPlaced"> {
|
59
|
+
/**
|
60
|
+
* A more descriptive label for accessibility purpose
|
61
|
+
*/
|
62
|
+
"aria-label"?: string;
|
63
|
+
/**
|
64
|
+
* Event handler called when the escape key is down.
|
65
|
+
* Can be prevented.
|
66
|
+
*/
|
67
|
+
onEscapeKeyDown?: DismissableLayerProps["onEscapeKeyDown"];
|
68
|
+
/**
|
69
|
+
* Event handler called when the a `pointerdown` event happens outside of the `Tooltip`.
|
70
|
+
* Can be prevented.
|
71
|
+
*/
|
72
|
+
onPointerDownOutside?: DismissableLayerProps["onPointerDownOutside"];
|
73
|
+
}
|
74
|
+
|
75
|
+
interface TooltipProviderProps {
|
76
|
+
children: React__default.ReactNode;
|
77
|
+
/**
|
78
|
+
* The duration from when the pointer enters the trigger until the tooltip gets opened.
|
79
|
+
* @defaultValue 700
|
80
|
+
*/
|
81
|
+
delayDuration?: number;
|
82
|
+
/**
|
83
|
+
* How much time a user has to enter another trigger without incurring a delay again.
|
84
|
+
* @defaultValue 300
|
85
|
+
*/
|
86
|
+
skipDelayDuration?: number;
|
87
|
+
/**
|
88
|
+
* When `true`, trying to hover the content will result in the tooltip closing as the pointer leaves the trigger.
|
89
|
+
* @defaultValue false
|
90
|
+
*/
|
91
|
+
disableHoverableContent?: boolean;
|
92
|
+
}
|
93
|
+
declare const TooltipProvider: React__default.FC<TooltipProviderProps>;
|
94
|
+
|
95
|
+
type PopperArrowProps = React__default.ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>;
|
96
|
+
interface TooltipArrowProps extends PopperArrowProps {
|
97
|
+
}
|
98
|
+
declare const TooltipArrow: React__default.ForwardRefExoticComponent<TooltipArrowProps & React__default.RefAttributes<SVGSVGElement>>;
|
99
|
+
|
100
|
+
export { Root, Tooltip, TooltipArrow, type TooltipArrowProps, TooltipContent, type TooltipContentProps, TooltipPortal, type TooltipPortalProps, type TooltipProps, TooltipProvider, type TooltipProviderProps, TooltipTrigger, type TooltipTriggerProps };
|
package/dist/index.d.ts
ADDED
@@ -0,0 +1,100 @@
|
|
1
|
+
import * as React$1 from 'react';
|
2
|
+
import React__default from 'react';
|
3
|
+
import { Portal } from '@huin-core/react-portal';
|
4
|
+
import * as PopperPrimitive from '@huin-core/react-popper';
|
5
|
+
import { DismissableLayer } from '@huin-core/react-dismissable-layer';
|
6
|
+
import { Primitive } from '@huin-core/react-primitive';
|
7
|
+
|
8
|
+
type PrimitiveButtonProps = React__default.ComponentPropsWithoutRef<typeof Primitive.button>;
|
9
|
+
interface TooltipTriggerProps extends PrimitiveButtonProps {
|
10
|
+
}
|
11
|
+
declare const TooltipTrigger: React__default.ForwardRefExoticComponent<TooltipTriggerProps & React__default.RefAttributes<HTMLButtonElement>>;
|
12
|
+
|
13
|
+
interface TooltipProps {
|
14
|
+
children?: React$1.ReactNode;
|
15
|
+
open?: boolean;
|
16
|
+
defaultOpen?: boolean;
|
17
|
+
onOpenChange?: (open: boolean) => void;
|
18
|
+
/**
|
19
|
+
* The duration from when the pointer enters the trigger until the tooltip gets opened. This will
|
20
|
+
* override the prop with the same name passed to Provider.
|
21
|
+
* @defaultValue 700
|
22
|
+
*/
|
23
|
+
delayDuration?: number;
|
24
|
+
/**
|
25
|
+
* When `true`, trying to hover the content will result in the tooltip closing as the pointer leaves the trigger.
|
26
|
+
* @defaultValue false
|
27
|
+
*/
|
28
|
+
disableHoverableContent?: boolean;
|
29
|
+
}
|
30
|
+
declare const Tooltip: React$1.FC<TooltipProps>;
|
31
|
+
declare const Root: React$1.FC<TooltipProps>;
|
32
|
+
|
33
|
+
type PortalProps = React.ComponentPropsWithoutRef<typeof Portal>;
|
34
|
+
interface TooltipPortalProps {
|
35
|
+
children?: React.ReactNode;
|
36
|
+
/**
|
37
|
+
* Specify a container element to portal the content into.
|
38
|
+
*/
|
39
|
+
container?: PortalProps["container"];
|
40
|
+
/**
|
41
|
+
* Used to force mounting when more control is needed. Useful when
|
42
|
+
* controlling animation with React animation libraries.
|
43
|
+
*/
|
44
|
+
forceMount?: true;
|
45
|
+
}
|
46
|
+
declare const TooltipPortal: React.FC<TooltipPortalProps>;
|
47
|
+
|
48
|
+
interface TooltipContentProps extends TooltipContentImplProps {
|
49
|
+
/**
|
50
|
+
* Used to force mounting when more control is needed. Useful when
|
51
|
+
* controlling animation with React animation libraries.
|
52
|
+
*/
|
53
|
+
forceMount?: true;
|
54
|
+
}
|
55
|
+
declare const TooltipContent: React__default.ForwardRefExoticComponent<TooltipContentProps & React__default.RefAttributes<HTMLDivElement>>;
|
56
|
+
type DismissableLayerProps = React__default.ComponentPropsWithoutRef<typeof DismissableLayer>;
|
57
|
+
type PopperContentProps = React__default.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;
|
58
|
+
interface TooltipContentImplProps extends Omit<PopperContentProps, "onPlaced"> {
|
59
|
+
/**
|
60
|
+
* A more descriptive label for accessibility purpose
|
61
|
+
*/
|
62
|
+
"aria-label"?: string;
|
63
|
+
/**
|
64
|
+
* Event handler called when the escape key is down.
|
65
|
+
* Can be prevented.
|
66
|
+
*/
|
67
|
+
onEscapeKeyDown?: DismissableLayerProps["onEscapeKeyDown"];
|
68
|
+
/**
|
69
|
+
* Event handler called when the a `pointerdown` event happens outside of the `Tooltip`.
|
70
|
+
* Can be prevented.
|
71
|
+
*/
|
72
|
+
onPointerDownOutside?: DismissableLayerProps["onPointerDownOutside"];
|
73
|
+
}
|
74
|
+
|
75
|
+
interface TooltipProviderProps {
|
76
|
+
children: React__default.ReactNode;
|
77
|
+
/**
|
78
|
+
* The duration from when the pointer enters the trigger until the tooltip gets opened.
|
79
|
+
* @defaultValue 700
|
80
|
+
*/
|
81
|
+
delayDuration?: number;
|
82
|
+
/**
|
83
|
+
* How much time a user has to enter another trigger without incurring a delay again.
|
84
|
+
* @defaultValue 300
|
85
|
+
*/
|
86
|
+
skipDelayDuration?: number;
|
87
|
+
/**
|
88
|
+
* When `true`, trying to hover the content will result in the tooltip closing as the pointer leaves the trigger.
|
89
|
+
* @defaultValue false
|
90
|
+
*/
|
91
|
+
disableHoverableContent?: boolean;
|
92
|
+
}
|
93
|
+
declare const TooltipProvider: React__default.FC<TooltipProviderProps>;
|
94
|
+
|
95
|
+
type PopperArrowProps = React__default.ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>;
|
96
|
+
interface TooltipArrowProps extends PopperArrowProps {
|
97
|
+
}
|
98
|
+
declare const TooltipArrow: React__default.ForwardRefExoticComponent<TooltipArrowProps & React__default.RefAttributes<SVGSVGElement>>;
|
99
|
+
|
100
|
+
export { Root, Tooltip, TooltipArrow, type TooltipArrowProps, TooltipContent, type TooltipContentProps, TooltipPortal, type TooltipPortalProps, type TooltipProps, TooltipProvider, type TooltipProviderProps, TooltipTrigger, type TooltipTriggerProps };
|