@fluentui/react-tooltip 0.0.0-nightly627ad67f1120211109.1 → 0.0.0-nightly695230dc7220220301.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.
Files changed (52) hide show
  1. package/CHANGELOG.json +413 -22
  2. package/CHANGELOG.md +106 -14
  3. package/MIGRATION.md +51 -43
  4. package/Spec.md +201 -337
  5. package/dist/react-tooltip.d.ts +38 -48
  6. package/lib/Tooltip.js.map +1 -1
  7. package/lib/components/Tooltip/Tooltip.d.ts +3 -2
  8. package/lib/components/Tooltip/Tooltip.js +9 -9
  9. package/lib/components/Tooltip/Tooltip.js.map +1 -1
  10. package/lib/components/Tooltip/Tooltip.types.d.ts +32 -39
  11. package/lib/components/Tooltip/Tooltip.types.js.map +1 -1
  12. package/lib/components/Tooltip/index.js.map +1 -1
  13. package/lib/components/Tooltip/private/constants.d.ts +12 -0
  14. package/lib/components/Tooltip/private/constants.js +14 -0
  15. package/lib/components/Tooltip/private/constants.js.map +1 -0
  16. package/lib/components/Tooltip/renderTooltip.d.ts +1 -1
  17. package/lib/components/Tooltip/renderTooltip.js +5 -4
  18. package/lib/components/Tooltip/renderTooltip.js.map +1 -1
  19. package/lib/components/Tooltip/useTooltip.d.ts +3 -6
  20. package/lib/components/Tooltip/useTooltip.js +44 -65
  21. package/lib/components/Tooltip/useTooltip.js.map +1 -1
  22. package/lib/components/Tooltip/useTooltipStyles.d.ts +1 -1
  23. package/lib/components/Tooltip/useTooltipStyles.js +47 -21
  24. package/lib/components/Tooltip/useTooltipStyles.js.map +1 -1
  25. package/lib/index.js.map +1 -1
  26. package/lib-commonjs/Tooltip.js.map +1 -1
  27. package/lib-commonjs/components/Tooltip/Tooltip.d.ts +3 -2
  28. package/lib-commonjs/components/Tooltip/Tooltip.js +8 -7
  29. package/lib-commonjs/components/Tooltip/Tooltip.js.map +1 -1
  30. package/lib-commonjs/components/Tooltip/Tooltip.types.d.ts +32 -39
  31. package/lib-commonjs/components/Tooltip/Tooltip.types.js.map +1 -1
  32. package/lib-commonjs/components/Tooltip/index.js.map +1 -1
  33. package/lib-commonjs/components/Tooltip/private/constants.d.ts +12 -0
  34. package/lib-commonjs/components/Tooltip/private/constants.js +21 -0
  35. package/lib-commonjs/components/Tooltip/private/constants.js.map +1 -0
  36. package/lib-commonjs/components/Tooltip/renderTooltip.d.ts +1 -1
  37. package/lib-commonjs/components/Tooltip/renderTooltip.js +7 -6
  38. package/lib-commonjs/components/Tooltip/renderTooltip.js.map +1 -1
  39. package/lib-commonjs/components/Tooltip/useTooltip.d.ts +3 -6
  40. package/lib-commonjs/components/Tooltip/useTooltip.js +49 -69
  41. package/lib-commonjs/components/Tooltip/useTooltip.js.map +1 -1
  42. package/lib-commonjs/components/Tooltip/useTooltipStyles.d.ts +1 -1
  43. package/lib-commonjs/components/Tooltip/useTooltipStyles.js +53 -24
  44. package/lib-commonjs/components/Tooltip/useTooltipStyles.js.map +1 -1
  45. package/lib-commonjs/index.js.map +1 -1
  46. package/package.json +12 -14
  47. package/lib/common/isConformant.d.ts +0 -4
  48. package/lib/common/isConformant.js +0 -11
  49. package/lib/common/isConformant.js.map +0 -1
  50. package/lib-commonjs/common/isConformant.d.ts +0 -4
  51. package/lib-commonjs/common/isConformant.js +0 -22
  52. package/lib-commonjs/common/isConformant.js.map +0 -1
package/MIGRATION.md CHANGED
@@ -6,55 +6,63 @@ This Migration guide is a work in progress and is not yet ready for use.
6
6
 
7
7
  ## Migration from v8
8
8
 
9
- The converged API does not support many of the custom features of the v8 tooltip. We may need to revisit and add additional features to the converged Tooltip if needed.
9
+ TooltipHost is replaced by Tooltip itself, as the wrapper around the element that should receive a tooltip.
10
10
 
11
11
  - `Tooltip`
12
- - `calloutProps` => Not supported. The arrow's visibility can be controlled using `noArrow`.
13
- - `componentRef` => `componentRef`
14
- - `delay` => `showDelay` on the TooltipTrigger
15
- - `directionalHint` => `position` and `align`
16
- - `topLeftEdge` => `position: 'above', align: 'start'`
17
- - `topCenter` => `position: 'above'`
18
- - `topRightEdge` => `position: 'above', align: 'end'`
12
+ - `calloutProps`
13
+ - `isBeakVisible` => `withArrow`
14
+ - `beakWidth` => Not supported.
15
+ - `gapSpace` => Not supported.
16
+ - `doNotLayer` => Not supported. Tooltips are always layered by rendering in a Portal.
17
+ - `setInitialFocus` => Not supported. Tooltips can't be focused, by design.
18
+ - `componentRef` => Not supported. Tooltips can be controlled declaratively with props like `visible`, instead of using an imperative API like `componentRef`.
19
+ - `delay` => `showDelay`
20
+ - `directionalHint` => `positioning`
21
+ - `topLeftEdge` => `positioning="above-start"`
22
+ - `topCenter` => `positioning="above"`
23
+ - `topRightEdge` => `positioning="above-end"`
19
24
  - `topAutoEdge` => Not supported
20
- - `bottomLeftEdge` => `position: 'below', align: 'start'`
21
- - `bottomCenter` => `position: 'below'`
22
- - `bottomRightEdge` => `position: 'below', align: 'end'`
25
+ - `bottomLeftEdge` => `positioning="below-start"`
26
+ - `bottomCenter` => `positioning="below"`
27
+ - `bottomRightEdge` => `positioning="below-end"`
23
28
  - `bottomAutoEdge` => Not supported
24
- - `leftTopEdge` => `position: 'before', align: 'top'`
25
- - `leftCenter` => `position: 'before'`
26
- - `leftBottomEdge` => `position: 'before', align: 'bottom'`
27
- - `rightTopEdge` => `position: 'after', align: 'top'`
28
- - `rightCenter` => `position: 'after'`
29
- - `rightBottomEdge` => `position: 'after', align: 'bottom'`
30
- - `directionalHintForRTL` => Automatic based on whether the element is in an RTL context
31
- - `maxWidth` => Add styling to the Tooltip: `tooltip={{ style: { maxWidth: ... }, children: 'Tooltip Content' }}`
32
- - `onRenderContent` => Set the Tooltip's `children` to a custom render function
33
- - `TooltipHost` => `TooltipTrigger`
34
- - `calloutProps` => Not supported
29
+ - `leftTopEdge` => `positioning="before-top"`
30
+ - `leftCenter` => `positioning="before"`
31
+ - `leftBottomEdge` => `positioning="before-bottom"`
32
+ - `rightTopEdge` => `positioning="after-top"`
33
+ - `rightCenter` => `positioning="after"`
34
+ - `rightBottomEdge` => `positioning="after-bottom"`
35
+ - `directionalHintForRTL` => Automatic based on whether the element is in an RTL context according to `FluentProvider`.
36
+ - `maxWidth` => Supported only through CSS styling of the `content` slot.
37
+ - `onRenderContent` => Set the `content` slot to a custom render function.
38
+ - `TooltipHost` => The tooltip itself is the "host".
35
39
  - `closeDelay` => `hideDelay`
36
- - `hostClassName` => Not needed because there is no element rendered by TooltipTrigger
37
- - `onTooltipToggle` => Not supported
38
- - `overflowMode` => `onlyIfTruncated`
39
- - `TooltipOverflowMode.self` => `onlyIfTruncated="true"`
40
- - `TooltipOverflowMode.parent` => `onlyIfTruncated="true"` and set `targetRef` to the parent element
40
+ - `hostClassName` => Not needed because there is no element rendered inline by Tooltip
41
+ - `onTooltipToggle` => `onVisibleChange`
42
+ - `overflowMode` => Not supported. If this behavior is needed, the tooltip's visibility can be controlled using the `visible` prop and `onVisibleChange` event.
41
43
 
42
44
  ## Migration from v0
43
45
 
44
- - `Tooltip` => `TooltipTrigger`
45
- - `content="..."` => `tooltip="..."`
46
- - `defaultOpen` => Not supported
47
- - `flipBoundary` => Not supported
48
- - `mountNode` => Unknown
46
+ The v9 Tooltip swaps the meaning of children between content and trigger. In v0, Tooltip's children is the tooltip content, and its trigger is a prop. In v9, that is swapped: Tooltip's children is the trigger, and its content is a prop.
47
+
48
+ - `Tooltip`
49
+ - children => `content`
50
+ - `trigger` => children
51
+ - `defaultOpen` => Not supported. The tooltip's visibility can be controlled using the `visible` prop and `onVisibleChange` event.
52
+ - `mountNode` => Not supported
53
+ - `open` => `visible`
54
+ - `onOpenChange` => `onVisibleChange`
55
+ - `pointing` => `withArrow`
56
+ - `mouseEnterDelay` => `showDelay`
49
57
  - `mouseLeaveDelay` => `hideDelay`
50
- - `offset` => `offset`
51
- - `onOpenChange` => Not supported
52
- - `open` => Not supported
53
- - `overflowBoundary` => Not supported
54
- - `pointing={false}` => `noArrow={true}`
55
- - `popperRef` => Not supported
56
- - `position` => `position`
57
- - `align` => `align`
58
- - `positionFixed` => Not supported
59
- - `target` => `targetRef`
60
- - `trigger` => The child of the `TooltipTrigger`
58
+ - `subtle={true}` = `appearance="normal"` (default)
59
+ - `subtle={false}` => `appearance="inverted"`
60
+ - Positioning props are now attributes of the `positioning` prop:
61
+ - `flipBoundary` => `positioning.flipBoundary`
62
+ - `offset` => `positioning.offset`
63
+ - `overflowBoundary` => `positioning.overflowBoundary`
64
+ - `popperRef` => `positioning.popperRef`
65
+ - `position` => `positioning.position`
66
+ - `align` => `positioning.align`
67
+ - `positionFixed` => `positioning.positionFixed`
68
+ - `target` => `positioning.target`