@radix-ui/react-hover-card 1.0.8-rc.9 → 1.1.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +40 -28
- package/dist/index.d.ts +40 -28
- package/dist/index.js +258 -274
- package/dist/index.js.map +7 -1
- package/dist/index.mjs +244 -262
- package/dist/index.mjs.map +7 -1
- package/package.json +10 -11
- package/dist/index.d.ts.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import * as PopperPrimitive from
|
|
3
|
-
import { Portal as
|
|
4
|
-
import * as Radix from
|
|
5
|
-
import { Primitive } from
|
|
6
|
-
import { DismissableLayer } from
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as PopperPrimitive from '@radix-ui/react-popper';
|
|
3
|
+
import { Portal as Portal$1 } from '@radix-ui/react-portal';
|
|
4
|
+
import * as Radix from '@radix-ui/react-primitive';
|
|
5
|
+
import { Primitive } from '@radix-ui/react-primitive';
|
|
6
|
+
import { DismissableLayer } from '@radix-ui/react-dismissable-layer';
|
|
7
|
+
|
|
8
|
+
declare type Scope<C = any> = {
|
|
9
|
+
[scopeName: string]: React.Context<C>[];
|
|
10
|
+
} | undefined;
|
|
11
|
+
declare type ScopeHook = (scope: Scope) => {
|
|
12
|
+
[__scopeProp: string]: Scope;
|
|
13
|
+
};
|
|
14
|
+
interface CreateScope {
|
|
15
|
+
scopeName: string;
|
|
16
|
+
(): ScopeHook;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare const createHoverCardScope: CreateScope;
|
|
20
|
+
interface HoverCardProps {
|
|
9
21
|
children?: React.ReactNode;
|
|
10
22
|
open?: boolean;
|
|
11
23
|
defaultOpen?: boolean;
|
|
@@ -13,13 +25,13 @@ export interface HoverCardProps {
|
|
|
13
25
|
openDelay?: number;
|
|
14
26
|
closeDelay?: number;
|
|
15
27
|
}
|
|
16
|
-
|
|
17
|
-
type PrimitiveLinkProps = Radix.ComponentPropsWithoutRef<typeof Primitive.a>;
|
|
18
|
-
|
|
28
|
+
declare const HoverCard: React.FC<HoverCardProps>;
|
|
29
|
+
declare type PrimitiveLinkProps = Radix.ComponentPropsWithoutRef<typeof Primitive.a>;
|
|
30
|
+
interface HoverCardTriggerProps extends PrimitiveLinkProps {
|
|
19
31
|
}
|
|
20
|
-
|
|
21
|
-
type PortalProps = React.ComponentPropsWithoutRef<typeof
|
|
22
|
-
|
|
32
|
+
declare const HoverCardTrigger: React.ForwardRefExoticComponent<HoverCardTriggerProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
33
|
+
declare type PortalProps = React.ComponentPropsWithoutRef<typeof Portal$1>;
|
|
34
|
+
interface HoverCardPortalProps {
|
|
23
35
|
children?: React.ReactNode;
|
|
24
36
|
/**
|
|
25
37
|
* Specify a container element to portal the content into.
|
|
@@ -31,17 +43,17 @@ export interface HoverCardPortalProps {
|
|
|
31
43
|
*/
|
|
32
44
|
forceMount?: true;
|
|
33
45
|
}
|
|
34
|
-
|
|
35
|
-
|
|
46
|
+
declare const HoverCardPortal: React.FC<HoverCardPortalProps>;
|
|
47
|
+
interface HoverCardContentProps extends HoverCardContentImplProps {
|
|
36
48
|
/**
|
|
37
49
|
* Used to force mounting when more control is needed. Useful when
|
|
38
50
|
* controlling animation with React animation libraries.
|
|
39
51
|
*/
|
|
40
52
|
forceMount?: true;
|
|
41
53
|
}
|
|
42
|
-
|
|
43
|
-
type DismissableLayerProps = Radix.ComponentPropsWithoutRef<typeof DismissableLayer>;
|
|
44
|
-
type PopperContentProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;
|
|
54
|
+
declare const HoverCardContent: React.ForwardRefExoticComponent<HoverCardContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
55
|
+
declare type DismissableLayerProps = Radix.ComponentPropsWithoutRef<typeof DismissableLayer>;
|
|
56
|
+
declare type PopperContentProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;
|
|
45
57
|
interface HoverCardContentImplProps extends Omit<PopperContentProps, 'onPlaced'> {
|
|
46
58
|
/**
|
|
47
59
|
* Event handler called when the escape key is down.
|
|
@@ -65,14 +77,14 @@ interface HoverCardContentImplProps extends Omit<PopperContentProps, 'onPlaced'>
|
|
|
65
77
|
*/
|
|
66
78
|
onInteractOutside?: DismissableLayerProps['onInteractOutside'];
|
|
67
79
|
}
|
|
68
|
-
type PopperArrowProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>;
|
|
69
|
-
|
|
80
|
+
declare type PopperArrowProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>;
|
|
81
|
+
interface HoverCardArrowProps extends PopperArrowProps {
|
|
70
82
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
83
|
+
declare const HoverCardArrow: React.ForwardRefExoticComponent<HoverCardArrowProps & React.RefAttributes<SVGSVGElement>>;
|
|
84
|
+
declare const Root: React.FC<HoverCardProps>;
|
|
85
|
+
declare const Trigger: React.ForwardRefExoticComponent<HoverCardTriggerProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
86
|
+
declare const Portal: React.FC<HoverCardPortalProps>;
|
|
87
|
+
declare const Content: React.ForwardRefExoticComponent<HoverCardContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
88
|
+
declare const Arrow: React.ForwardRefExoticComponent<HoverCardArrowProps & React.RefAttributes<SVGSVGElement>>;
|
|
77
89
|
|
|
78
|
-
|
|
90
|
+
export { Arrow, Content, HoverCard, HoverCardArrow, type HoverCardArrowProps, HoverCardContent, type HoverCardContentProps, HoverCardPortal, type HoverCardPortalProps, type HoverCardProps, HoverCardTrigger, type HoverCardTriggerProps, Portal, Root, Trigger, createHoverCardScope };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,23 @@
|
|
|
1
|
-
import * as React from
|
|
2
|
-
import * as PopperPrimitive from
|
|
3
|
-
import { Portal as
|
|
4
|
-
import * as Radix from
|
|
5
|
-
import { Primitive } from
|
|
6
|
-
import { DismissableLayer } from
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as PopperPrimitive from '@radix-ui/react-popper';
|
|
3
|
+
import { Portal as Portal$1 } from '@radix-ui/react-portal';
|
|
4
|
+
import * as Radix from '@radix-ui/react-primitive';
|
|
5
|
+
import { Primitive } from '@radix-ui/react-primitive';
|
|
6
|
+
import { DismissableLayer } from '@radix-ui/react-dismissable-layer';
|
|
7
|
+
|
|
8
|
+
declare type Scope<C = any> = {
|
|
9
|
+
[scopeName: string]: React.Context<C>[];
|
|
10
|
+
} | undefined;
|
|
11
|
+
declare type ScopeHook = (scope: Scope) => {
|
|
12
|
+
[__scopeProp: string]: Scope;
|
|
13
|
+
};
|
|
14
|
+
interface CreateScope {
|
|
15
|
+
scopeName: string;
|
|
16
|
+
(): ScopeHook;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare const createHoverCardScope: CreateScope;
|
|
20
|
+
interface HoverCardProps {
|
|
9
21
|
children?: React.ReactNode;
|
|
10
22
|
open?: boolean;
|
|
11
23
|
defaultOpen?: boolean;
|
|
@@ -13,13 +25,13 @@ export interface HoverCardProps {
|
|
|
13
25
|
openDelay?: number;
|
|
14
26
|
closeDelay?: number;
|
|
15
27
|
}
|
|
16
|
-
|
|
17
|
-
type PrimitiveLinkProps = Radix.ComponentPropsWithoutRef<typeof Primitive.a>;
|
|
18
|
-
|
|
28
|
+
declare const HoverCard: React.FC<HoverCardProps>;
|
|
29
|
+
declare type PrimitiveLinkProps = Radix.ComponentPropsWithoutRef<typeof Primitive.a>;
|
|
30
|
+
interface HoverCardTriggerProps extends PrimitiveLinkProps {
|
|
19
31
|
}
|
|
20
|
-
|
|
21
|
-
type PortalProps = React.ComponentPropsWithoutRef<typeof
|
|
22
|
-
|
|
32
|
+
declare const HoverCardTrigger: React.ForwardRefExoticComponent<HoverCardTriggerProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
33
|
+
declare type PortalProps = React.ComponentPropsWithoutRef<typeof Portal$1>;
|
|
34
|
+
interface HoverCardPortalProps {
|
|
23
35
|
children?: React.ReactNode;
|
|
24
36
|
/**
|
|
25
37
|
* Specify a container element to portal the content into.
|
|
@@ -31,17 +43,17 @@ export interface HoverCardPortalProps {
|
|
|
31
43
|
*/
|
|
32
44
|
forceMount?: true;
|
|
33
45
|
}
|
|
34
|
-
|
|
35
|
-
|
|
46
|
+
declare const HoverCardPortal: React.FC<HoverCardPortalProps>;
|
|
47
|
+
interface HoverCardContentProps extends HoverCardContentImplProps {
|
|
36
48
|
/**
|
|
37
49
|
* Used to force mounting when more control is needed. Useful when
|
|
38
50
|
* controlling animation with React animation libraries.
|
|
39
51
|
*/
|
|
40
52
|
forceMount?: true;
|
|
41
53
|
}
|
|
42
|
-
|
|
43
|
-
type DismissableLayerProps = Radix.ComponentPropsWithoutRef<typeof DismissableLayer>;
|
|
44
|
-
type PopperContentProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;
|
|
54
|
+
declare const HoverCardContent: React.ForwardRefExoticComponent<HoverCardContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
55
|
+
declare type DismissableLayerProps = Radix.ComponentPropsWithoutRef<typeof DismissableLayer>;
|
|
56
|
+
declare type PopperContentProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;
|
|
45
57
|
interface HoverCardContentImplProps extends Omit<PopperContentProps, 'onPlaced'> {
|
|
46
58
|
/**
|
|
47
59
|
* Event handler called when the escape key is down.
|
|
@@ -65,14 +77,14 @@ interface HoverCardContentImplProps extends Omit<PopperContentProps, 'onPlaced'>
|
|
|
65
77
|
*/
|
|
66
78
|
onInteractOutside?: DismissableLayerProps['onInteractOutside'];
|
|
67
79
|
}
|
|
68
|
-
type PopperArrowProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>;
|
|
69
|
-
|
|
80
|
+
declare type PopperArrowProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>;
|
|
81
|
+
interface HoverCardArrowProps extends PopperArrowProps {
|
|
70
82
|
}
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
83
|
+
declare const HoverCardArrow: React.ForwardRefExoticComponent<HoverCardArrowProps & React.RefAttributes<SVGSVGElement>>;
|
|
84
|
+
declare const Root: React.FC<HoverCardProps>;
|
|
85
|
+
declare const Trigger: React.ForwardRefExoticComponent<HoverCardTriggerProps & React.RefAttributes<HTMLAnchorElement>>;
|
|
86
|
+
declare const Portal: React.FC<HoverCardPortalProps>;
|
|
87
|
+
declare const Content: React.ForwardRefExoticComponent<HoverCardContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
88
|
+
declare const Arrow: React.ForwardRefExoticComponent<HoverCardArrowProps & React.RefAttributes<SVGSVGElement>>;
|
|
77
89
|
|
|
78
|
-
|
|
90
|
+
export { Arrow, Content, HoverCard, HoverCardArrow, type HoverCardArrowProps, HoverCardContent, type HoverCardContentProps, HoverCardPortal, type HoverCardPortalProps, type HoverCardProps, HoverCardTrigger, type HoverCardTriggerProps, Portal, Root, Trigger, createHoverCardScope };
|