@fluentui/react-tooltip 9.0.0-rc.9 → 9.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.json +293 -1
- package/CHANGELOG.md +91 -2
- package/dist/index.d.ts +42 -51
- package/{lib → dist}/tsdoc-metadata.json +0 -0
- package/lib/components/Tooltip/Tooltip.js.map +1 -1
- package/lib/components/Tooltip/Tooltip.types.js.map +1 -1
- package/lib/components/Tooltip/renderTooltip.js.map +1 -1
- package/lib/components/Tooltip/useTooltip.js +11 -11
- package/lib/components/Tooltip/useTooltip.js.map +1 -1
- package/lib/components/Tooltip/useTooltipStyles.js +17 -24
- package/lib/components/Tooltip/useTooltipStyles.js.map +1 -1
- package/lib/index.js +1 -2
- package/lib/index.js.map +1 -1
- package/lib-commonjs/components/Tooltip/Tooltip.js.map +1 -1
- package/lib-commonjs/components/Tooltip/renderTooltip.js.map +1 -1
- package/lib-commonjs/components/Tooltip/useTooltip.js +10 -10
- package/lib-commonjs/components/Tooltip/useTooltip.js.map +1 -1
- package/lib-commonjs/components/Tooltip/useTooltipStyles.js +18 -25
- package/lib-commonjs/components/Tooltip/useTooltipStyles.js.map +1 -1
- package/lib-commonjs/index.js +1 -8
- package/lib-commonjs/index.js.map +1 -1
- package/package.json +10 -12
- package/lib/Tooltip.d.ts +0 -1
- package/lib/components/Tooltip/Tooltip.d.ts +0 -7
- package/lib/components/Tooltip/Tooltip.types.d.ts +0 -118
- package/lib/components/Tooltip/index.d.ts +0 -5
- package/lib/components/Tooltip/private/constants.d.ts +0 -12
- package/lib/components/Tooltip/renderTooltip.d.ts +0 -5
- package/lib/components/Tooltip/useTooltip.d.ts +0 -10
- package/lib/components/Tooltip/useTooltipStyles.d.ts +0 -11
- package/lib/index.d.ts +0 -2
- package/lib-commonjs/Tooltip.d.ts +0 -1
- package/lib-commonjs/components/Tooltip/Tooltip.d.ts +0 -7
- package/lib-commonjs/components/Tooltip/Tooltip.types.d.ts +0 -118
- package/lib-commonjs/components/Tooltip/index.d.ts +0 -5
- package/lib-commonjs/components/Tooltip/private/constants.d.ts +0 -12
- package/lib-commonjs/components/Tooltip/renderTooltip.d.ts +0 -5
- package/lib-commonjs/components/Tooltip/useTooltip.d.ts +0 -10
- package/lib-commonjs/components/Tooltip/useTooltipStyles.d.ts +0 -11
- package/lib-commonjs/index.d.ts +0 -2
package/package.json
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
{
|
2
2
|
"name": "@fluentui/react-tooltip",
|
3
|
-
"version": "9.0.0
|
3
|
+
"version": "9.0.0",
|
4
4
|
"description": "React components for building web experiences",
|
5
5
|
"main": "lib-commonjs/index.js",
|
6
6
|
"module": "lib/index.js",
|
7
|
-
"typings": "
|
7
|
+
"typings": "dist/index.d.ts",
|
8
8
|
"sideEffects": false,
|
9
9
|
"repository": {
|
10
10
|
"type": "git",
|
@@ -28,16 +28,16 @@
|
|
28
28
|
"devDependencies": {
|
29
29
|
"@fluentui/eslint-plugin": "*",
|
30
30
|
"@fluentui/react-conformance": "*",
|
31
|
-
"@fluentui/react-conformance-griffel": "9.0.0-beta.
|
31
|
+
"@fluentui/react-conformance-griffel": "9.0.0-beta.9",
|
32
32
|
"@fluentui/scripts": "^1.0.0"
|
33
33
|
},
|
34
34
|
"dependencies": {
|
35
|
-
"@fluentui/react-portal": "9.0.0
|
36
|
-
"@fluentui/react-positioning": "9.0.0
|
37
|
-
"@fluentui/react-shared-contexts": "9.0.0
|
38
|
-
"@fluentui/react-theme": "9.0.0
|
39
|
-
"@fluentui/react-utilities": "9.0.0
|
40
|
-
"@griffel/react": "1.0
|
35
|
+
"@fluentui/react-portal": "^9.0.0",
|
36
|
+
"@fluentui/react-positioning": "^9.0.0",
|
37
|
+
"@fluentui/react-shared-contexts": "^9.0.0",
|
38
|
+
"@fluentui/react-theme": "^9.0.0",
|
39
|
+
"@fluentui/react-utilities": "^9.0.0",
|
40
|
+
"@griffel/react": "1.2.0",
|
41
41
|
"tslib": "^2.1.0"
|
42
42
|
},
|
43
43
|
"peerDependencies": {
|
@@ -48,9 +48,7 @@
|
|
48
48
|
},
|
49
49
|
"beachball": {
|
50
50
|
"disallowedChangeTypes": [
|
51
|
-
"major"
|
52
|
-
"minor",
|
53
|
-
"patch"
|
51
|
+
"major"
|
54
52
|
]
|
55
53
|
},
|
56
54
|
"exports": {
|
package/lib/Tooltip.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/Tooltip/index';
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import type { TooltipProps } from './Tooltip.types';
|
3
|
-
import type { FluentTriggerComponent } from '@fluentui/react-utilities';
|
4
|
-
/**
|
5
|
-
* A tooltip provides light weight contextual information on top of its target element.
|
6
|
-
*/
|
7
|
-
export declare const Tooltip: React.FC<TooltipProps> & FluentTriggerComponent;
|
@@ -1,118 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import type { PositioningShorthand } from '@fluentui/react-positioning';
|
3
|
-
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
4
|
-
import type { PortalProps } from '@fluentui/react-portal';
|
5
|
-
/**
|
6
|
-
* Slot properties for Tooltip
|
7
|
-
*/
|
8
|
-
export declare type TooltipSlots = {
|
9
|
-
/**
|
10
|
-
* The text or JSX content of the tooltip.
|
11
|
-
*/
|
12
|
-
content: NonNullable<Slot<'div'>>;
|
13
|
-
};
|
14
|
-
/**
|
15
|
-
* Properties and state for Tooltip
|
16
|
-
*/
|
17
|
-
declare type TooltipCommons = Pick<PortalProps, 'mountNode'> & {
|
18
|
-
/**
|
19
|
-
* (Required) Specifies whether this tooltip is acting as the description or label of its trigger element.
|
20
|
-
*
|
21
|
-
* * `label` - The tooltip sets the trigger's aria-label or aria-labelledby attribute. This is useful for buttons
|
22
|
-
* displaying only an icon, for example.
|
23
|
-
* * `description` - The tooltip sets the trigger's aria-description or aria-describedby attribute.
|
24
|
-
* * `inaccessible` - No aria attributes are set on the trigger. This makes the tooltip's content inaccessible to
|
25
|
-
* screen readers, and should only be used if the tooltip's text is available by some other means.
|
26
|
-
*/
|
27
|
-
relationship: 'label' | 'description' | 'inaccessible';
|
28
|
-
/**
|
29
|
-
* The tooltip's visual appearance.
|
30
|
-
* * `normal` - Uses the theme's background and text colors.
|
31
|
-
* * `inverted` - Higher contrast variant that uses the theme's inverted colors.
|
32
|
-
*
|
33
|
-
* @defaultvalue normal
|
34
|
-
*/
|
35
|
-
appearance?: 'normal' | 'inverted';
|
36
|
-
/**
|
37
|
-
* Render an arrow pointing to the target element
|
38
|
-
*
|
39
|
-
* @defaultvalue false
|
40
|
-
*/
|
41
|
-
withArrow?: boolean;
|
42
|
-
/**
|
43
|
-
* Configure the positioning of the tooltip
|
44
|
-
*
|
45
|
-
* @defaultvalue above
|
46
|
-
*/
|
47
|
-
positioning?: PositioningShorthand;
|
48
|
-
/**
|
49
|
-
* Control the tooltip's visibility programatically.
|
50
|
-
*
|
51
|
-
* This can be used in conjunction with onVisibleChange to modify the tooltip's show and hide behavior.
|
52
|
-
*
|
53
|
-
* If not provided, the visibility will be controlled by the tooltip itself, based on hover and focus events on the
|
54
|
-
* trigger (child) element.
|
55
|
-
*/
|
56
|
-
visible?: boolean;
|
57
|
-
/**
|
58
|
-
* Notification when the visibility of the tooltip is changing
|
59
|
-
*/
|
60
|
-
onVisibleChange?: (event: React.PointerEvent<HTMLElement> | React.FocusEvent<HTMLElement> | undefined, data: OnVisibleChangeData) => void;
|
61
|
-
/**
|
62
|
-
* Delay before the tooltip is shown, in milliseconds.
|
63
|
-
*
|
64
|
-
* @defaultvalue 250
|
65
|
-
*/
|
66
|
-
showDelay: number;
|
67
|
-
/**
|
68
|
-
* Delay before the tooltip is hidden, in milliseconds.
|
69
|
-
*
|
70
|
-
* @defaultvalue 250
|
71
|
-
*/
|
72
|
-
hideDelay: number;
|
73
|
-
};
|
74
|
-
/**
|
75
|
-
* The properties that are added to the trigger of the Tooltip
|
76
|
-
*/
|
77
|
-
export declare type TooltipTriggerProps = {
|
78
|
-
ref?: React.Ref<never>;
|
79
|
-
} & Pick<React.HTMLAttributes<HTMLElement>, 'onPointerEnter' | 'onPointerLeave' | 'onFocus' | 'onBlur' | 'aria-describedby' | 'aria-labelledby' | 'aria-label'>;
|
80
|
-
/**
|
81
|
-
* Data for the Tooltip's onVisibleChange event.
|
82
|
-
*/
|
83
|
-
export declare type OnVisibleChangeData = {
|
84
|
-
visible: boolean;
|
85
|
-
};
|
86
|
-
/**
|
87
|
-
* Properties for Tooltip
|
88
|
-
*/
|
89
|
-
export declare type TooltipProps = ComponentProps<TooltipSlots> & Partial<Omit<TooltipCommons, 'relationship'>> & Pick<TooltipCommons, 'relationship'> & {
|
90
|
-
/**
|
91
|
-
* The tooltip can have a single JSX child, or a render function that accepts TooltipTriggerProps.
|
92
|
-
*
|
93
|
-
* If no child is provided, the tooltip's target must be set with the `positioning` prop, and its
|
94
|
-
* visibility must be controlled with the `visible` prop.
|
95
|
-
*/
|
96
|
-
children?: (React.ReactElement & {
|
97
|
-
ref?: React.Ref<unknown>;
|
98
|
-
}) | ((props: TooltipTriggerProps) => React.ReactElement | null) | null;
|
99
|
-
};
|
100
|
-
/**
|
101
|
-
* State used in rendering Tooltip
|
102
|
-
*/
|
103
|
-
export declare type TooltipState = ComponentState<TooltipSlots> & TooltipCommons & {
|
104
|
-
children?: React.ReactElement | null;
|
105
|
-
/**
|
106
|
-
* Whether the tooltip should be rendered to the DOM.
|
107
|
-
*/
|
108
|
-
shouldRenderTooltip?: boolean;
|
109
|
-
/**
|
110
|
-
* Ref to the arrow element
|
111
|
-
*/
|
112
|
-
arrowRef?: React.Ref<HTMLDivElement>;
|
113
|
-
/**
|
114
|
-
* CSS class for the arrow element
|
115
|
-
*/
|
116
|
-
arrowClassName?: string;
|
117
|
-
};
|
118
|
-
export {};
|
@@ -1,12 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* The height of the tooltip's arrow in pixels.
|
3
|
-
*/
|
4
|
-
export declare const arrowHeight = 6;
|
5
|
-
/**
|
6
|
-
* The default value of the tooltip's border radius (borderRadiusMedium).
|
7
|
-
*
|
8
|
-
* Unfortunately, Popper requires it to be specified as a variable instead of using CSS.
|
9
|
-
* While we could use getComputedStyle, that adds a performance penalty for something that
|
10
|
-
* will likely never change.
|
11
|
-
*/
|
12
|
-
export declare const tooltipBorderRadius = 4;
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import type { TooltipProps, TooltipState } from './Tooltip.types';
|
2
|
-
/**
|
3
|
-
* Create the state required to render Tooltip.
|
4
|
-
*
|
5
|
-
* The returned state can be modified with hooks such as useTooltipStyles_unstable,
|
6
|
-
* before being passed to renderTooltip_unstable.
|
7
|
-
*
|
8
|
-
* @param props - props from this instance of Tooltip
|
9
|
-
*/
|
10
|
-
export declare const useTooltip_unstable: (props: TooltipProps) => TooltipState;
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import type { TooltipSlots, TooltipState } from './Tooltip.types';
|
2
|
-
import type { SlotClassNames } from '@fluentui/react-utilities';
|
3
|
-
/**
|
4
|
-
* @deprecated Use `tooltipClassNames.root` instead.
|
5
|
-
*/
|
6
|
-
export declare const tooltipClassName = "fui-Tooltip";
|
7
|
-
export declare const tooltipClassNames: SlotClassNames<TooltipSlots>;
|
8
|
-
/**
|
9
|
-
* Apply styling to the Tooltip slots based on the state
|
10
|
-
*/
|
11
|
-
export declare const useTooltipStyles_unstable: (state: TooltipState) => TooltipState;
|
package/lib/index.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export * from './components/Tooltip/index';
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import type { TooltipProps } from './Tooltip.types';
|
3
|
-
import type { FluentTriggerComponent } from '@fluentui/react-utilities';
|
4
|
-
/**
|
5
|
-
* A tooltip provides light weight contextual information on top of its target element.
|
6
|
-
*/
|
7
|
-
export declare const Tooltip: React.FC<TooltipProps> & FluentTriggerComponent;
|
@@ -1,118 +0,0 @@
|
|
1
|
-
import * as React from 'react';
|
2
|
-
import type { PositioningShorthand } from '@fluentui/react-positioning';
|
3
|
-
import type { ComponentProps, ComponentState, Slot } from '@fluentui/react-utilities';
|
4
|
-
import type { PortalProps } from '@fluentui/react-portal';
|
5
|
-
/**
|
6
|
-
* Slot properties for Tooltip
|
7
|
-
*/
|
8
|
-
export declare type TooltipSlots = {
|
9
|
-
/**
|
10
|
-
* The text or JSX content of the tooltip.
|
11
|
-
*/
|
12
|
-
content: NonNullable<Slot<'div'>>;
|
13
|
-
};
|
14
|
-
/**
|
15
|
-
* Properties and state for Tooltip
|
16
|
-
*/
|
17
|
-
declare type TooltipCommons = Pick<PortalProps, 'mountNode'> & {
|
18
|
-
/**
|
19
|
-
* (Required) Specifies whether this tooltip is acting as the description or label of its trigger element.
|
20
|
-
*
|
21
|
-
* * `label` - The tooltip sets the trigger's aria-label or aria-labelledby attribute. This is useful for buttons
|
22
|
-
* displaying only an icon, for example.
|
23
|
-
* * `description` - The tooltip sets the trigger's aria-description or aria-describedby attribute.
|
24
|
-
* * `inaccessible` - No aria attributes are set on the trigger. This makes the tooltip's content inaccessible to
|
25
|
-
* screen readers, and should only be used if the tooltip's text is available by some other means.
|
26
|
-
*/
|
27
|
-
relationship: 'label' | 'description' | 'inaccessible';
|
28
|
-
/**
|
29
|
-
* The tooltip's visual appearance.
|
30
|
-
* * `normal` - Uses the theme's background and text colors.
|
31
|
-
* * `inverted` - Higher contrast variant that uses the theme's inverted colors.
|
32
|
-
*
|
33
|
-
* @defaultvalue normal
|
34
|
-
*/
|
35
|
-
appearance?: 'normal' | 'inverted';
|
36
|
-
/**
|
37
|
-
* Render an arrow pointing to the target element
|
38
|
-
*
|
39
|
-
* @defaultvalue false
|
40
|
-
*/
|
41
|
-
withArrow?: boolean;
|
42
|
-
/**
|
43
|
-
* Configure the positioning of the tooltip
|
44
|
-
*
|
45
|
-
* @defaultvalue above
|
46
|
-
*/
|
47
|
-
positioning?: PositioningShorthand;
|
48
|
-
/**
|
49
|
-
* Control the tooltip's visibility programatically.
|
50
|
-
*
|
51
|
-
* This can be used in conjunction with onVisibleChange to modify the tooltip's show and hide behavior.
|
52
|
-
*
|
53
|
-
* If not provided, the visibility will be controlled by the tooltip itself, based on hover and focus events on the
|
54
|
-
* trigger (child) element.
|
55
|
-
*/
|
56
|
-
visible?: boolean;
|
57
|
-
/**
|
58
|
-
* Notification when the visibility of the tooltip is changing
|
59
|
-
*/
|
60
|
-
onVisibleChange?: (event: React.PointerEvent<HTMLElement> | React.FocusEvent<HTMLElement> | undefined, data: OnVisibleChangeData) => void;
|
61
|
-
/**
|
62
|
-
* Delay before the tooltip is shown, in milliseconds.
|
63
|
-
*
|
64
|
-
* @defaultvalue 250
|
65
|
-
*/
|
66
|
-
showDelay: number;
|
67
|
-
/**
|
68
|
-
* Delay before the tooltip is hidden, in milliseconds.
|
69
|
-
*
|
70
|
-
* @defaultvalue 250
|
71
|
-
*/
|
72
|
-
hideDelay: number;
|
73
|
-
};
|
74
|
-
/**
|
75
|
-
* The properties that are added to the trigger of the Tooltip
|
76
|
-
*/
|
77
|
-
export declare type TooltipTriggerProps = {
|
78
|
-
ref?: React.Ref<never>;
|
79
|
-
} & Pick<React.HTMLAttributes<HTMLElement>, 'onPointerEnter' | 'onPointerLeave' | 'onFocus' | 'onBlur' | 'aria-describedby' | 'aria-labelledby' | 'aria-label'>;
|
80
|
-
/**
|
81
|
-
* Data for the Tooltip's onVisibleChange event.
|
82
|
-
*/
|
83
|
-
export declare type OnVisibleChangeData = {
|
84
|
-
visible: boolean;
|
85
|
-
};
|
86
|
-
/**
|
87
|
-
* Properties for Tooltip
|
88
|
-
*/
|
89
|
-
export declare type TooltipProps = ComponentProps<TooltipSlots> & Partial<Omit<TooltipCommons, 'relationship'>> & Pick<TooltipCommons, 'relationship'> & {
|
90
|
-
/**
|
91
|
-
* The tooltip can have a single JSX child, or a render function that accepts TooltipTriggerProps.
|
92
|
-
*
|
93
|
-
* If no child is provided, the tooltip's target must be set with the `positioning` prop, and its
|
94
|
-
* visibility must be controlled with the `visible` prop.
|
95
|
-
*/
|
96
|
-
children?: (React.ReactElement & {
|
97
|
-
ref?: React.Ref<unknown>;
|
98
|
-
}) | ((props: TooltipTriggerProps) => React.ReactElement | null) | null;
|
99
|
-
};
|
100
|
-
/**
|
101
|
-
* State used in rendering Tooltip
|
102
|
-
*/
|
103
|
-
export declare type TooltipState = ComponentState<TooltipSlots> & TooltipCommons & {
|
104
|
-
children?: React.ReactElement | null;
|
105
|
-
/**
|
106
|
-
* Whether the tooltip should be rendered to the DOM.
|
107
|
-
*/
|
108
|
-
shouldRenderTooltip?: boolean;
|
109
|
-
/**
|
110
|
-
* Ref to the arrow element
|
111
|
-
*/
|
112
|
-
arrowRef?: React.Ref<HTMLDivElement>;
|
113
|
-
/**
|
114
|
-
* CSS class for the arrow element
|
115
|
-
*/
|
116
|
-
arrowClassName?: string;
|
117
|
-
};
|
118
|
-
export {};
|
@@ -1,12 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* The height of the tooltip's arrow in pixels.
|
3
|
-
*/
|
4
|
-
export declare const arrowHeight = 6;
|
5
|
-
/**
|
6
|
-
* The default value of the tooltip's border radius (borderRadiusMedium).
|
7
|
-
*
|
8
|
-
* Unfortunately, Popper requires it to be specified as a variable instead of using CSS.
|
9
|
-
* While we could use getComputedStyle, that adds a performance penalty for something that
|
10
|
-
* will likely never change.
|
11
|
-
*/
|
12
|
-
export declare const tooltipBorderRadius = 4;
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import type { TooltipProps, TooltipState } from './Tooltip.types';
|
2
|
-
/**
|
3
|
-
* Create the state required to render Tooltip.
|
4
|
-
*
|
5
|
-
* The returned state can be modified with hooks such as useTooltipStyles_unstable,
|
6
|
-
* before being passed to renderTooltip_unstable.
|
7
|
-
*
|
8
|
-
* @param props - props from this instance of Tooltip
|
9
|
-
*/
|
10
|
-
export declare const useTooltip_unstable: (props: TooltipProps) => TooltipState;
|
@@ -1,11 +0,0 @@
|
|
1
|
-
import type { TooltipSlots, TooltipState } from './Tooltip.types';
|
2
|
-
import type { SlotClassNames } from '@fluentui/react-utilities';
|
3
|
-
/**
|
4
|
-
* @deprecated Use `tooltipClassNames.root` instead.
|
5
|
-
*/
|
6
|
-
export declare const tooltipClassName = "fui-Tooltip";
|
7
|
-
export declare const tooltipClassNames: SlotClassNames<TooltipSlots>;
|
8
|
-
/**
|
9
|
-
* Apply styling to the Tooltip slots based on the state
|
10
|
-
*/
|
11
|
-
export declare const useTooltipStyles_unstable: (state: TooltipState) => TooltipState;
|
package/lib-commonjs/index.d.ts
DELETED