@fluentui/react-tooltip 0.0.0-nightlyfc5cfdc52420220215.1 → 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. package/CHANGELOG.json +589 -17
  2. package/CHANGELOG.md +281 -111
  3. package/MIGRATION.md +51 -43
  4. package/Spec.md +201 -337
  5. package/dist/{react-tooltip.d.ts → index.d.ts} +42 -35
  6. package/{lib → dist}/tsdoc-metadata.json +0 -0
  7. package/lib/Tooltip.js.map +1 -1
  8. package/lib/components/Tooltip/Tooltip.js.map +1 -1
  9. package/lib/components/Tooltip/Tooltip.types.js.map +1 -1
  10. package/lib/components/Tooltip/index.js.map +1 -1
  11. package/lib/components/Tooltip/private/constants.js.map +1 -1
  12. package/lib/components/Tooltip/renderTooltip.js +3 -1
  13. package/lib/components/Tooltip/renderTooltip.js.map +1 -1
  14. package/lib/components/Tooltip/useTooltip.js +34 -41
  15. package/lib/components/Tooltip/useTooltip.js.map +1 -1
  16. package/lib/components/Tooltip/useTooltipStyles.js +20 -18
  17. package/lib/components/Tooltip/useTooltipStyles.js.map +1 -1
  18. package/lib/index.js +1 -1
  19. package/lib/index.js.map +1 -1
  20. package/lib-commonjs/Tooltip.js.map +1 -1
  21. package/lib-commonjs/components/Tooltip/Tooltip.js.map +1 -1
  22. package/lib-commonjs/components/Tooltip/Tooltip.types.js.map +1 -1
  23. package/lib-commonjs/components/Tooltip/index.js.map +1 -1
  24. package/lib-commonjs/components/Tooltip/private/constants.js.map +1 -1
  25. package/lib-commonjs/components/Tooltip/renderTooltip.js +3 -1
  26. package/lib-commonjs/components/Tooltip/renderTooltip.js.map +1 -1
  27. package/lib-commonjs/components/Tooltip/useTooltip.js +33 -40
  28. package/lib-commonjs/components/Tooltip/useTooltip.js.map +1 -1
  29. package/lib-commonjs/components/Tooltip/useTooltipStyles.js +21 -19
  30. package/lib-commonjs/components/Tooltip/useTooltipStyles.js.map +1 -1
  31. package/lib-commonjs/index.js +32 -2
  32. package/lib-commonjs/index.js.map +1 -1
  33. package/package.json +20 -25
  34. package/lib/Tooltip.d.ts +0 -1
  35. package/lib/components/Tooltip/Tooltip.d.ts +0 -7
  36. package/lib/components/Tooltip/Tooltip.types.d.ts +0 -108
  37. package/lib/components/Tooltip/index.d.ts +0 -5
  38. package/lib/components/Tooltip/private/constants.d.ts +0 -12
  39. package/lib/components/Tooltip/renderTooltip.d.ts +0 -5
  40. package/lib/components/Tooltip/useTooltip.d.ts +0 -10
  41. package/lib/components/Tooltip/useTooltipStyles.d.ts +0 -6
  42. package/lib/index.d.ts +0 -1
  43. package/lib-commonjs/Tooltip.d.ts +0 -1
  44. package/lib-commonjs/components/Tooltip/Tooltip.d.ts +0 -7
  45. package/lib-commonjs/components/Tooltip/Tooltip.types.d.ts +0 -108
  46. package/lib-commonjs/components/Tooltip/index.d.ts +0 -5
  47. package/lib-commonjs/components/Tooltip/private/constants.d.ts +0 -12
  48. package/lib-commonjs/components/Tooltip/renderTooltip.d.ts +0 -5
  49. package/lib-commonjs/components/Tooltip/useTooltip.d.ts +0 -10
  50. package/lib-commonjs/components/Tooltip/useTooltipStyles.d.ts +0 -6
  51. package/lib-commonjs/index.d.ts +0 -1
@@ -1,108 +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
- /**
5
- * Slot properties for Tooltip
6
- */
7
- export declare type TooltipSlots = {
8
- content: NonNullable<Slot<'div'>>;
9
- };
10
- /**
11
- * Properties and state for Tooltip
12
- */
13
- declare type TooltipCommons = {
14
- /**
15
- * The tooltip's visual appearance.
16
- * * `normal` - Uses the theme's background and text colors.
17
- * * `inverted` - Higher contrast variant that uses the theme's inverted colors.
18
- *
19
- * @defaultvalue normal
20
- */
21
- appearance?: 'normal' | 'inverted';
22
- /**
23
- * Render an arrow pointing to the target element
24
- *
25
- * @defaultvalue false
26
- */
27
- withArrow?: boolean;
28
- /**
29
- * Configure the positioning of the tooltip
30
- *
31
- * @defaultvalue above
32
- */
33
- positioning?: PositioningShorthand;
34
- /**
35
- * Control the tooltip's visibility programatically.
36
- *
37
- * This can be used in conjunction with onVisibleChange to modify the tooltip's show and hide behavior.
38
- *
39
- * If not provided, the visibility will be controlled by the tooltip itself, based on hover and focus events on the
40
- * trigger (child) element.
41
- */
42
- visible?: boolean;
43
- /**
44
- * Notification when the visibility of the tooltip is changing
45
- */
46
- onVisibleChange?: (event: React.PointerEvent<HTMLElement> | React.FocusEvent<HTMLElement> | undefined, data: OnVisibleChangeData) => void;
47
- /**
48
- * (Required) Specifies whether this tooltip is acting as the description or label of its trigger element.
49
- *
50
- * * `label` - The tooltip sets the trigger's aria-label or aria-labelledby attribute. This is useful for buttons
51
- * displaying only an icon, for example.
52
- * * `description` - The tooltip sets the trigger's aria-description or aria-describedby attribute.
53
- * * `inaccessible` - No aria attributes are set on the trigger. This makes the tooltip's content inaccessible to
54
- * screen readers, and should only be used if the tooltip's text is available by some other means.
55
- */
56
- relationship: 'label' | 'description' | 'inaccessible';
57
- /**
58
- * Delay before the tooltip is shown, in milliseconds.
59
- *
60
- * @defaultvalue 250
61
- */
62
- showDelay: number;
63
- /**
64
- * Delay before the tooltip is hidden, in milliseconds.
65
- *
66
- * @defaultvalue 250
67
- */
68
- hideDelay: number;
69
- };
70
- /**
71
- * The properties that are added to the trigger of the Tooltip
72
- */
73
- export declare type TooltipTriggerProps = {
74
- ref?: React.Ref<never>;
75
- } & Pick<React.HTMLAttributes<HTMLElement>, 'onPointerEnter' | 'onPointerLeave' | 'onFocus' | 'onBlur' | 'aria-describedby' | 'aria-labelledby' | 'aria-label'>;
76
- /**
77
- * Data for the Tooltip's onVisibleChange event.
78
- */
79
- export declare type OnVisibleChangeData = {
80
- visible: boolean;
81
- };
82
- /**
83
- * Properties for Tooltip
84
- */
85
- export declare type TooltipProps = ComponentProps<TooltipSlots> & Partial<Omit<TooltipCommons, 'relationship'>> & Pick<TooltipCommons, 'relationship'> & {
86
- children?: (React.ReactElement & {
87
- ref?: React.Ref<unknown>;
88
- }) | ((props: TooltipTriggerProps) => React.ReactElement | null) | null;
89
- };
90
- /**
91
- * State used in rendering Tooltip
92
- */
93
- export declare type TooltipState = ComponentState<TooltipSlots> & TooltipCommons & {
94
- children?: React.ReactElement | null;
95
- /**
96
- * Whether the tooltip should be rendered to the DOM.
97
- */
98
- shouldRenderTooltip?: boolean;
99
- /**
100
- * Ref to the arrow element
101
- */
102
- arrowRef?: React.Ref<HTMLDivElement>;
103
- /**
104
- * CSS class for the arrow element
105
- */
106
- arrowClassName?: string;
107
- };
108
- export {};
@@ -1,5 +0,0 @@
1
- export * from './Tooltip';
2
- export * from './Tooltip.types';
3
- export * from './renderTooltip';
4
- export * from './useTooltip';
5
- export * from './useTooltipStyles';
@@ -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,5 +0,0 @@
1
- import type { TooltipState } from './Tooltip.types';
2
- /**
3
- * Render the final JSX of Tooltip
4
- */
5
- export declare const renderTooltip_unstable: (state: TooltipState) => JSX.Element;
@@ -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,6 +0,0 @@
1
- import type { TooltipState } from './Tooltip.types';
2
- export declare const tooltipClassName = "fui-Tooltip";
3
- /**
4
- * Apply styling to the Tooltip slots based on the state
5
- */
6
- export declare const useTooltipStyles_unstable: (state: TooltipState) => TooltipState;
@@ -1 +0,0 @@
1
- export * from './Tooltip';