@fluentui/react-positioning 0.0.0-nightlyc0273fdc6920211123.1 → 0.0.0-nightlyc0e3a0a1f320220217.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. package/CHANGELOG.json +134 -10
  2. package/CHANGELOG.md +38 -8
  3. package/dist/react-positioning.d.ts +96 -46
  4. package/lib/createArrowStyles.d.ts +47 -10
  5. package/lib/createArrowStyles.js +68 -56
  6. package/lib/createArrowStyles.js.map +1 -1
  7. package/lib/createVirtualElementFromClick.js +17 -15
  8. package/lib/createVirtualElementFromClick.js.map +1 -1
  9. package/lib/types.d.ts +28 -7
  10. package/lib/usePopper.d.ts +2 -14
  11. package/lib/usePopper.js +367 -311
  12. package/lib/usePopper.js.map +1 -1
  13. package/lib/usePopperMouseTarget.js +28 -22
  14. package/lib/usePopperMouseTarget.js.map +1 -1
  15. package/lib/utils/getBasePlacement.js +1 -1
  16. package/lib/utils/getBasePlacement.js.map +1 -1
  17. package/lib/utils/getBoundary.js +15 -10
  18. package/lib/utils/getBoundary.js.map +1 -1
  19. package/lib/utils/getReactFiberFromNode.js +39 -35
  20. package/lib/utils/getReactFiberFromNode.js.map +1 -1
  21. package/lib/utils/getScrollParent.js +46 -32
  22. package/lib/utils/getScrollParent.js.map +1 -1
  23. package/lib/utils/mergeArrowOffset.js +29 -24
  24. package/lib/utils/mergeArrowOffset.js.map +1 -1
  25. package/lib/utils/positioningHelper.d.ts +2 -2
  26. package/lib/utils/positioningHelper.js +38 -30
  27. package/lib/utils/positioningHelper.js.map +1 -1
  28. package/lib/utils/resolvePositioningShorthand.js +57 -19
  29. package/lib/utils/resolvePositioningShorthand.js.map +1 -1
  30. package/lib/utils/useCallbackRef.js +35 -29
  31. package/lib/utils/useCallbackRef.js.map +1 -1
  32. package/lib-commonjs/createArrowStyles.d.ts +47 -10
  33. package/lib-commonjs/createArrowStyles.js +80 -59
  34. package/lib-commonjs/createArrowStyles.js.map +1 -1
  35. package/lib-commonjs/createVirtualElementFromClick.js +23 -16
  36. package/lib-commonjs/createVirtualElementFromClick.js.map +1 -1
  37. package/lib-commonjs/index.js +26 -5
  38. package/lib-commonjs/index.js.map +1 -1
  39. package/lib-commonjs/types.d.ts +28 -7
  40. package/lib-commonjs/types.js +4 -1
  41. package/lib-commonjs/types.js.map +1 -1
  42. package/lib-commonjs/usePopper.d.ts +2 -14
  43. package/lib-commonjs/usePopper.js +382 -316
  44. package/lib-commonjs/usePopper.js.map +1 -1
  45. package/lib-commonjs/usePopperMouseTarget.js +38 -25
  46. package/lib-commonjs/usePopperMouseTarget.js.map +1 -1
  47. package/lib-commonjs/utils/getBasePlacement.js +7 -2
  48. package/lib-commonjs/utils/getBasePlacement.js.map +1 -1
  49. package/lib-commonjs/utils/getBoundary.js +23 -12
  50. package/lib-commonjs/utils/getBoundary.js.map +1 -1
  51. package/lib-commonjs/utils/getReactFiberFromNode.js +44 -36
  52. package/lib-commonjs/utils/getReactFiberFromNode.js.map +1 -1
  53. package/lib-commonjs/utils/getScrollParent.js +53 -33
  54. package/lib-commonjs/utils/getScrollParent.js.map +1 -1
  55. package/lib-commonjs/utils/index.js +14 -2
  56. package/lib-commonjs/utils/index.js.map +1 -1
  57. package/lib-commonjs/utils/mergeArrowOffset.js +35 -25
  58. package/lib-commonjs/utils/mergeArrowOffset.js.map +1 -1
  59. package/lib-commonjs/utils/positioningHelper.d.ts +2 -2
  60. package/lib-commonjs/utils/positioningHelper.js +46 -31
  61. package/lib-commonjs/utils/positioningHelper.js.map +1 -1
  62. package/lib-commonjs/utils/resolvePositioningShorthand.js +65 -22
  63. package/lib-commonjs/utils/resolvePositioningShorthand.js.map +1 -1
  64. package/lib-commonjs/utils/useCallbackRef.js +45 -32
  65. package/lib-commonjs/utils/useCallbackRef.js.map +1 -1
  66. package/package.json +7 -8
@@ -1,23 +1,11 @@
1
- import * as PopperJs from '@popperjs/core';
2
1
  import * as React from 'react';
3
2
  import type { PositioningProps } from './types';
4
- interface PopperOptions extends PositioningProps {
3
+ interface UsePopperOptions extends PositioningProps {
5
4
  /**
6
5
  * If false, delays Popper's creation.
7
6
  * @default true
8
7
  */
9
8
  enabled?: boolean;
10
- onStateUpdate?: (state: Partial<PopperJs.State>) => void;
11
- /**
12
- * Enables the Popper box to position itself in 'fixed' mode (default value is position: 'absolute')
13
- * @default false
14
- */
15
- positionFixed?: boolean;
16
- /**
17
- * When the reference element or the viewport is outside viewport allows a popper element to be fully in viewport.
18
- * "all" enables this behavior for all axis.
19
- */
20
- unstable_disableTether?: boolean | 'all';
21
9
  }
22
10
  /**
23
11
  * Exposes Popper positioning API via React hook. Contains few important differences between an official "react-popper"
@@ -27,7 +15,7 @@ interface PopperOptions extends PositioningProps {
27
15
  * - contains a specific to React fix related to initial positioning when containers have components with managed focus
28
16
  * to avoid focus jumps
29
17
  */
30
- export declare function usePopper(options?: PopperOptions): {
18
+ export declare function usePopper(options?: UsePopperOptions): {
31
19
  targetRef: React.MutableRefObject<any>;
32
20
  containerRef: React.MutableRefObject<any>;
33
21
  arrowRef: React.MutableRefObject<any>;