@fluentui/react-positioning 0.0.0-nightly6a6e258c4020220125.1 → 0.0.0-nightly6faffd280a20220221.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. package/CHANGELOG.json +74 -20
  2. package/CHANGELOG.md +31 -9
  3. package/dist/react-positioning.d.ts +51 -40
  4. package/lib/createArrowStyles.d.ts +5 -5
  5. package/lib/createArrowStyles.js +1 -1
  6. package/lib/createArrowStyles.js.map +1 -1
  7. package/lib/createVirtualElementFromClick.js.map +1 -1
  8. package/lib/index.js.map +1 -1
  9. package/lib/types.d.ts +28 -7
  10. package/lib/types.js.map +1 -1
  11. package/lib/usePopper.d.ts +2 -14
  12. package/lib/usePopper.js +40 -34
  13. package/lib/usePopper.js.map +1 -1
  14. package/lib/usePopperMouseTarget.js.map +1 -1
  15. package/lib/utils/getBasePlacement.js.map +1 -1
  16. package/lib/utils/getBoundary.js.map +1 -1
  17. package/lib/utils/getReactFiberFromNode.js.map +1 -1
  18. package/lib/utils/getScrollParent.js.map +1 -1
  19. package/lib/utils/index.js.map +1 -1
  20. package/lib/utils/mergeArrowOffset.js.map +1 -1
  21. package/lib/utils/positioningHelper.js.map +1 -1
  22. package/lib/utils/resolvePositioningShorthand.js.map +1 -1
  23. package/lib/utils/useCallbackRef.js.map +1 -1
  24. package/lib-commonjs/createArrowStyles.d.ts +5 -5
  25. package/lib-commonjs/createArrowStyles.js +3 -3
  26. package/lib-commonjs/createArrowStyles.js.map +1 -1
  27. package/lib-commonjs/createVirtualElementFromClick.js.map +1 -1
  28. package/lib-commonjs/index.js.map +1 -1
  29. package/lib-commonjs/types.d.ts +28 -7
  30. package/lib-commonjs/types.js.map +1 -1
  31. package/lib-commonjs/usePopper.d.ts +2 -14
  32. package/lib-commonjs/usePopper.js +41 -35
  33. package/lib-commonjs/usePopper.js.map +1 -1
  34. package/lib-commonjs/usePopperMouseTarget.js.map +1 -1
  35. package/lib-commonjs/utils/getBasePlacement.js.map +1 -1
  36. package/lib-commonjs/utils/getBoundary.js.map +1 -1
  37. package/lib-commonjs/utils/getReactFiberFromNode.js.map +1 -1
  38. package/lib-commonjs/utils/getScrollParent.js.map +1 -1
  39. package/lib-commonjs/utils/index.js.map +1 -1
  40. package/lib-commonjs/utils/mergeArrowOffset.js.map +1 -1
  41. package/lib-commonjs/utils/positioningHelper.js.map +1 -1
  42. package/lib-commonjs/utils/resolvePositioningShorthand.js.map +1 -1
  43. package/lib-commonjs/utils/useCallbackRef.js.map +1 -1
  44. package/package.json +5 -6
package/CHANGELOG.json CHANGED
@@ -2,17 +2,65 @@
2
2
  "name": "@fluentui/react-positioning",
3
3
  "entries": [
4
4
  {
5
- "date": "Tue, 25 Jan 2022 04:17:20 GMT",
6
- "tag": "@fluentui/react-positioning_v0.0.0-nightly6a6e258c4020220125.1",
7
- "version": "0.0.0-nightly6a6e258c4020220125.1",
5
+ "date": "Mon, 21 Feb 2022 04:15:29 GMT",
6
+ "tag": "@fluentui/react-positioning_v0.0.0-nightly6faffd280a20220221.1",
7
+ "version": "0.0.0-nightly6faffd280a20220221.1",
8
8
  "comments": {
9
9
  "prerelease": [
10
10
  {
11
11
  "author": "email not defined",
12
12
  "package": "@fluentui/react-positioning",
13
- "commit": "1d41ec351a6d5902e871c87fcbaacf8db8ecb40d",
13
+ "commit": "01ee61722cce4da8e5deb9a2ab00f4e27fc01cfd",
14
14
  "comment": "Release nightly v9"
15
15
  },
16
+ {
17
+ "author": "beachball",
18
+ "package": "@fluentui/react-positioning",
19
+ "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly6faffd280a20220221.1",
20
+ "commit": "01ee61722cce4da8e5deb9a2ab00f4e27fc01cfd"
21
+ },
22
+ {
23
+ "author": "beachball",
24
+ "package": "@fluentui/react-positioning",
25
+ "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly6faffd280a20220221.1",
26
+ "commit": "01ee61722cce4da8e5deb9a2ab00f4e27fc01cfd"
27
+ }
28
+ ]
29
+ }
30
+ },
31
+ {
32
+ "date": "Fri, 18 Feb 2022 13:35:33 GMT",
33
+ "tag": "@fluentui/react-positioning_v9.0.0-rc.3",
34
+ "version": "9.0.0-rc.3",
35
+ "comments": {
36
+ "prerelease": [
37
+ {
38
+ "author": "lingfangao@hotmail.com",
39
+ "package": "@fluentui/react-positioning",
40
+ "commit": "1aa9e691fcccd9a64168cea7941c0f1e71fa1d14",
41
+ "comment": "fix: Source maps contain original source code"
42
+ },
43
+ {
44
+ "author": "beachball",
45
+ "package": "@fluentui/react-positioning",
46
+ "comment": "Bump @fluentui/react-shared-contexts to v9.0.0-rc.3",
47
+ "commit": "3b9c1e931c23173da3d1af0c696cdc58516ce504"
48
+ },
49
+ {
50
+ "author": "beachball",
51
+ "package": "@fluentui/react-positioning",
52
+ "comment": "Bump @fluentui/react-utilities to v9.0.0-rc.3",
53
+ "commit": "3b9c1e931c23173da3d1af0c696cdc58516ce504"
54
+ }
55
+ ]
56
+ }
57
+ },
58
+ {
59
+ "date": "Thu, 10 Feb 2022 08:50:40 GMT",
60
+ "tag": "@fluentui/react-positioning_v9.0.0-rc.1",
61
+ "version": "9.0.0-rc.1",
62
+ "comments": {
63
+ "prerelease": [
16
64
  {
17
65
  "author": "olfedias@microsoft.com",
18
66
  "package": "@fluentui/react-positioning",
@@ -31,6 +79,18 @@
31
79
  "commit": "2e34c026a354af1bbfe6a5ead1ade41348d5488f",
32
80
  "comment": "Fix tooltip arrow's high contrast border in RTL"
33
81
  },
82
+ {
83
+ "author": "olfedias@microsoft.com",
84
+ "package": "@fluentui/react-positioning",
85
+ "commit": "523b5785eafd28cf56b677af40274cefe5d42dcb",
86
+ "comment": "use Griffel packages"
87
+ },
88
+ {
89
+ "author": "lingfangao@hotmail.com",
90
+ "package": "@fluentui/react-positioning",
91
+ "commit": "a548a59bd94f9c4b656da3bdd149db7ac2de726f",
92
+ "comment": "feat: Imperative `setTarget` for `usePopper` and `positioning`"
93
+ },
34
94
  {
35
95
  "author": "bsunderhus@microsoft.com",
36
96
  "package": "@fluentui/react-positioning",
@@ -44,34 +104,28 @@
44
104
  "comment": "update styles to not use CSS shorthands"
45
105
  },
46
106
  {
47
- "author": "behowell@microsoft.com",
48
- "package": "@fluentui/react-positioning",
49
- "commit": "09804275c7f346db54c33d4ff347bffc33676014",
50
- "comment": "Fix popover arrow styling"
51
- },
52
- {
53
- "author": "beachball",
107
+ "author": "lingfangao@hotmail.com",
54
108
  "package": "@fluentui/react-positioning",
55
- "comment": "Bump @fluentui/react-make-styles to v0.0.0-nightly6a6e258c4020220125.1",
56
- "commit": "1d41ec351a6d5902e871c87fcbaacf8db8ecb40d"
109
+ "commit": "c00913d50e2dd15bbfbb0757cefe43b192ff1d7f",
110
+ "comment": "Bump Fluent UI packages to 9.0.0-rc"
57
111
  },
58
112
  {
59
- "author": "beachball",
113
+ "author": "behowell@microsoft.com",
60
114
  "package": "@fluentui/react-positioning",
61
- "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly6a6e258c4020220125.1",
62
- "commit": "1d41ec351a6d5902e871c87fcbaacf8db8ecb40d"
115
+ "commit": "09804275c7f346db54c33d4ff347bffc33676014",
116
+ "comment": "Fix popover arrow styling"
63
117
  },
64
118
  {
65
119
  "author": "beachball",
66
120
  "package": "@fluentui/react-positioning",
67
- "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly6a6e258c4020220125.1",
68
- "commit": "1d41ec351a6d5902e871c87fcbaacf8db8ecb40d"
121
+ "comment": "Bump @fluentui/react-shared-contexts to v9.0.0-rc.1",
122
+ "commit": "e6c855f6d9019d6c73668d15fc9bc3a13291a6c8"
69
123
  },
70
124
  {
71
125
  "author": "beachball",
72
126
  "package": "@fluentui/react-positioning",
73
- "comment": "Bump @fluentui/babel-make-styles to v0.0.0-nightly6a6e258c4020220125.1",
74
- "commit": "1d41ec351a6d5902e871c87fcbaacf8db8ecb40d"
127
+ "comment": "Bump @fluentui/react-utilities to v9.0.0-rc.1",
128
+ "commit": "e6c855f6d9019d6c73668d15fc9bc3a13291a6c8"
75
129
  }
76
130
  ],
77
131
  "none": [
package/CHANGELOG.md CHANGED
@@ -1,27 +1,49 @@
1
1
  # Change Log - @fluentui/react-positioning
2
2
 
3
- This log was last generated on Tue, 25 Jan 2022 04:17:20 GMT and should not be manually modified.
3
+ This log was last generated on Mon, 21 Feb 2022 04:15:29 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightly6a6e258c4020220125.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v0.0.0-nightly6a6e258c4020220125.1)
7
+ ## [0.0.0-nightly6faffd280a20220221.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v0.0.0-nightly6faffd280a20220221.1)
8
8
 
9
- Tue, 25 Jan 2022 04:17:20 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.0.0-beta.4..@fluentui/react-positioning_v0.0.0-nightly6a6e258c4020220125.1)
9
+ Mon, 21 Feb 2022 04:15:29 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.0.0-rc.3..@fluentui/react-positioning_v0.0.0-nightly6faffd280a20220221.1)
11
+
12
+ ### Changes
13
+
14
+ - Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/01ee61722cce4da8e5deb9a2ab00f4e27fc01cfd) by email not defined)
15
+ - Bump @fluentui/react-shared-contexts to v0.0.0-nightly6faffd280a20220221.1 ([commit](https://github.com/microsoft/fluentui/commit/01ee61722cce4da8e5deb9a2ab00f4e27fc01cfd) by beachball)
16
+ - Bump @fluentui/react-utilities to v0.0.0-nightly6faffd280a20220221.1 ([commit](https://github.com/microsoft/fluentui/commit/01ee61722cce4da8e5deb9a2ab00f4e27fc01cfd) by beachball)
17
+
18
+ ## [9.0.0-rc.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.0.0-rc.3)
19
+
20
+ Fri, 18 Feb 2022 13:35:33 GMT
21
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.0.0-rc.1..@fluentui/react-positioning_v9.0.0-rc.3)
22
+
23
+ ### Changes
24
+
25
+ - fix: Source maps contain original source code ([PR #21690](https://github.com/microsoft/fluentui/pull/21690) by lingfangao@hotmail.com)
26
+ - Bump @fluentui/react-shared-contexts to v9.0.0-rc.3 ([PR #21800](https://github.com/microsoft/fluentui/pull/21800) by beachball)
27
+ - Bump @fluentui/react-utilities to v9.0.0-rc.3 ([PR #21800](https://github.com/microsoft/fluentui/pull/21800) by beachball)
28
+
29
+ ## [9.0.0-rc.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.0.0-rc.1)
30
+
31
+ Thu, 10 Feb 2022 08:50:40 GMT
32
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.0.0-beta.4..@fluentui/react-positioning_v9.0.0-rc.1)
11
33
 
12
34
  ### Changes
13
35
 
14
- - Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/1d41ec351a6d5902e871c87fcbaacf8db8ecb40d) by email not defined)
15
36
  - use new types from makeStyles core ([PR #20786](https://github.com/microsoft/fluentui/pull/20786) by olfedias@microsoft.com)
16
37
  - Replacing use of functions in makeStyles with direct use of tokens. ([PR #21051](https://github.com/microsoft/fluentui/pull/21051) by Humberto.Morimoto@microsoft.com)
17
38
  - Fix tooltip arrow's high contrast border in RTL ([PR #21354](https://github.com/microsoft/fluentui/pull/21354) by behowell@microsoft.com)
39
+ - use Griffel packages ([PR #21421](https://github.com/microsoft/fluentui/pull/21421) by olfedias@microsoft.com)
40
+ - feat: Imperative `setTarget` for `usePopper` and `positioning` ([PR #21632](https://github.com/microsoft/fluentui/pull/21632) by lingfangao@hotmail.com)
18
41
  - Adds @noflip annotation to data-popper-placement styles ([PR #20845](https://github.com/microsoft/fluentui/pull/20845) by bsunderhus@microsoft.com)
19
42
  - update styles to not use CSS shorthands ([PR #20842](https://github.com/microsoft/fluentui/pull/20842) by olfedias@microsoft.com)
43
+ - Bump Fluent UI packages to 9.0.0-rc ([PR #21623](https://github.com/microsoft/fluentui/pull/21623) by lingfangao@hotmail.com)
20
44
  - Fix popover arrow styling ([PR #21086](https://github.com/microsoft/fluentui/pull/21086) by behowell@microsoft.com)
21
- - Bump @fluentui/react-make-styles to v0.0.0-nightly6a6e258c4020220125.1 ([commit](https://github.com/microsoft/fluentui/commit/1d41ec351a6d5902e871c87fcbaacf8db8ecb40d) by beachball)
22
- - Bump @fluentui/react-shared-contexts to v0.0.0-nightly6a6e258c4020220125.1 ([commit](https://github.com/microsoft/fluentui/commit/1d41ec351a6d5902e871c87fcbaacf8db8ecb40d) by beachball)
23
- - Bump @fluentui/react-utilities to v0.0.0-nightly6a6e258c4020220125.1 ([commit](https://github.com/microsoft/fluentui/commit/1d41ec351a6d5902e871c87fcbaacf8db8ecb40d) by beachball)
24
- - Bump @fluentui/babel-make-styles to v0.0.0-nightly6a6e258c4020220125.1 ([commit](https://github.com/microsoft/fluentui/commit/1d41ec351a6d5902e871c87fcbaacf8db8ecb40d) by beachball)
45
+ - Bump @fluentui/react-shared-contexts to v9.0.0-rc.1 ([commit](https://github.com/microsoft/fluentui/commit/e6c855f6d9019d6c73668d15fc9bc3a13291a6c8) by beachball)
46
+ - Bump @fluentui/react-utilities to v9.0.0-rc.1 ([commit](https://github.com/microsoft/fluentui/commit/e6c855f6d9019d6c73668d15fc9bc3a13291a6c8) by beachball)
25
47
 
26
48
  ## [9.0.0-beta.4](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.0.0-beta.4)
27
49
 
@@ -1,4 +1,4 @@
1
- import type { MakeStylesStyle } from '@fluentui/react-make-styles';
1
+ import type { GriffelStyle } from '@griffel/react';
2
2
  import * as PopperJs from '@popperjs/core';
3
3
  import * as React_2 from 'react';
4
4
 
@@ -41,7 +41,7 @@ export declare function createArrowHeightStyles(arrowHeight: number): {
41
41
  * )
42
42
  * ```
43
43
  */
44
- export declare function createArrowStyles(options: CreateArrowStylesOptions): MakeStylesStyle;
44
+ export declare function createArrowStyles(options: CreateArrowStylesOptions): GriffelStyle;
45
45
 
46
46
  /**
47
47
  * Options parameter for the createArrowStyles function
@@ -59,19 +59,19 @@ export declare type CreateArrowStylesOptions = {
59
59
  *
60
60
  * @defaultvalue 1px
61
61
  */
62
- borderWidth?: MakeStylesStyle['borderBottomWidth'];
62
+ borderWidth?: GriffelStyle['borderBottomWidth'];
63
63
  /**
64
64
  * The borderStyle for the arrow. Should be the same borderStyle as the parent element.
65
65
  *
66
66
  * @defaultvalue solid
67
67
  */
68
- borderStyle?: MakeStylesStyle['borderBottomStyle'];
68
+ borderStyle?: GriffelStyle['borderBottomStyle'];
69
69
  /**
70
70
  * The borderColor of the arrow. Should be the same borderColor as the parent element.
71
71
  *
72
72
  * @defaultvalue tokens.colorTransparentStroke
73
73
  */
74
- borderColor?: MakeStylesStyle['borderBottomColor'];
74
+ borderColor?: GriffelStyle['borderBottomColor'];
75
75
  };
76
76
 
77
77
  /**
@@ -100,42 +100,13 @@ export declare type OffsetFunctionParam = {
100
100
  placement: PopperJs.Placement;
101
101
  };
102
102
 
103
- declare interface PopperOptions extends PositioningProps {
104
- /**
105
- * If false, delays Popper's creation.
106
- * @default true
107
- */
108
- enabled?: boolean;
109
- onStateUpdate?: (state: Partial<PopperJs.State>) => void;
110
- /**
111
- * Enables the Popper box to position itself in 'fixed' mode (default value is position: 'absolute')
112
- * @default false
113
- */
114
- positionFixed?: boolean;
115
- /**
116
- * When the reference element or the viewport is outside viewport allows a popper element to be fully in viewport.
117
- * "all" enables this behavior for all axis.
118
- */
119
- unstable_disableTether?: boolean | 'all';
120
- }
121
-
122
- export declare type PopperRefHandle = {
123
- updatePosition: () => void;
124
- };
125
-
126
- export declare type PopperVirtualElement = PopperJs.VirtualElement;
127
-
128
- export declare type Position = 'above' | 'below' | 'before' | 'after';
129
-
130
- export declare interface PositioningProps {
103
+ export declare interface PopperOptions {
131
104
  /** Alignment for the component. Only has an effect if used with the @see position option */
132
105
  align?: Alignment;
133
106
  /** The element which will define the boundaries of the popper position for the flip behavior. */
134
107
  flipBoundary?: Boundary;
135
108
  /** The element which will define the boundaries of the popper position for the overflow behavior. */
136
109
  overflowBoundary?: Boundary;
137
- /** An imperative handle to Popper methods. */
138
- popperRef?: React_2.Ref<PopperRefHandle>;
139
110
  /**
140
111
  * Position for the component. Position has higher priority than align. If position is vertical ('above' | 'below')
141
112
  * and align is also vertical ('top' | 'bottom') or if both position and align are horizontal ('before' | 'after'
@@ -143,6 +114,11 @@ export declare interface PositioningProps {
143
114
  * then provided value for 'align' will be ignored and 'center' will be used instead.
144
115
  */
145
116
  position?: Position;
117
+ /**
118
+ * Enables the Popper box to position itself in 'fixed' mode (default value is position: 'absolute')
119
+ * @default false
120
+ */
121
+ positionFixed?: boolean;
146
122
  /**
147
123
  * Lets you displace a popper element from its reference element.
148
124
  * This can be useful if you need to apply some margin between them or if you need to fine tune the
@@ -162,10 +138,6 @@ export declare interface PositioningProps {
162
138
  * `height-always` applies `max-height` regardless of overflow, and 'width-always' for always applying `max-width`
163
139
  */
164
140
  autoSize?: AutoSize;
165
- /**
166
- * Manual override for popper target. Useful for scenarios where a component accepts user prop to override target
167
- */
168
- target?: HTMLElement | PopperVirtualElement | null;
169
141
  /**
170
142
  * Modifies position and alignment to cover the target
171
143
  */
@@ -175,6 +147,37 @@ export declare interface PositioningProps {
175
147
  * `position` props, regardless of the size of the component, the reference element or the viewport.
176
148
  */
177
149
  pinned?: boolean;
150
+ /**
151
+ * When the reference element or the viewport is outside viewport allows a popper element to be fully in viewport.
152
+ * "all" enables this behavior for all axis.
153
+ */
154
+ unstable_disableTether?: boolean | 'all';
155
+ }
156
+
157
+ export declare type PopperRefHandle = {
158
+ /**
159
+ * Updates the position of the popper imperatively.
160
+ * Useful when the position of the target changes from other factors than scrolling of window resize.
161
+ */
162
+ updatePosition: () => void;
163
+ /**
164
+ * Sets the target and updates positioning imperatively.
165
+ * Useful for avoiding double renders with the target option.
166
+ */
167
+ setTarget: (target: HTMLElement) => void;
168
+ };
169
+
170
+ export declare type PopperVirtualElement = PopperJs.VirtualElement;
171
+
172
+ export declare type Position = 'above' | 'below' | 'before' | 'after';
173
+
174
+ export declare interface PositioningProps extends Omit<PopperOptions, 'positionFixed' | 'unstable_disableTether'> {
175
+ /** An imperative handle to Popper methods. */
176
+ popperRef?: React_2.Ref<PopperRefHandle>;
177
+ /**
178
+ * Manual override for popper target. Useful for scenarios where a component accepts user prop to override target
179
+ */
180
+ target?: HTMLElement | PopperVirtualElement | null;
178
181
  }
179
182
 
180
183
  export declare type PositioningShorthand = PositioningProps | PositioningShorthandValue;
@@ -191,7 +194,7 @@ export declare function resolvePositioningShorthand(shorthand: PositioningShorth
191
194
  * - contains a specific to React fix related to initial positioning when containers have components with managed focus
192
195
  * to avoid focus jumps
193
196
  */
194
- export declare function usePopper(options?: PopperOptions): {
197
+ export declare function usePopper(options?: UsePopperOptions): {
195
198
  targetRef: React_2.MutableRefObject<any>;
196
199
  containerRef: React_2.MutableRefObject<any>;
197
200
  arrowRef: React_2.MutableRefObject<any>;
@@ -207,4 +210,12 @@ export declare function usePopper(options?: PopperOptions): {
207
210
  */
208
211
  export declare const usePopperMouseTarget: (initialState?: PopperJs.VirtualElement | (() => PopperJs.VirtualElement) | undefined) => readonly [PopperJs.VirtualElement | undefined, (event: React_2.MouseEvent | MouseEvent | undefined | null) => void];
209
212
 
213
+ declare interface UsePopperOptions extends PositioningProps {
214
+ /**
215
+ * If false, delays Popper's creation.
216
+ * @default true
217
+ */
218
+ enabled?: boolean;
219
+ }
220
+
210
221
  export { }
@@ -1,4 +1,4 @@
1
- import type { MakeStylesStyle } from '@fluentui/react-make-styles';
1
+ import type { GriffelStyle } from '@griffel/react';
2
2
  /**
3
3
  * Options parameter for the createArrowStyles function
4
4
  */
@@ -15,19 +15,19 @@ export declare type CreateArrowStylesOptions = {
15
15
  *
16
16
  * @defaultvalue 1px
17
17
  */
18
- borderWidth?: MakeStylesStyle['borderBottomWidth'];
18
+ borderWidth?: GriffelStyle['borderBottomWidth'];
19
19
  /**
20
20
  * The borderStyle for the arrow. Should be the same borderStyle as the parent element.
21
21
  *
22
22
  * @defaultvalue solid
23
23
  */
24
- borderStyle?: MakeStylesStyle['borderBottomStyle'];
24
+ borderStyle?: GriffelStyle['borderBottomStyle'];
25
25
  /**
26
26
  * The borderColor of the arrow. Should be the same borderColor as the parent element.
27
27
  *
28
28
  * @defaultvalue tokens.colorTransparentStroke
29
29
  */
30
- borderColor?: MakeStylesStyle['borderBottomColor'];
30
+ borderColor?: GriffelStyle['borderBottomColor'];
31
31
  };
32
32
  /**
33
33
  * Helper that creates a makeStyles rule for an arrow element.
@@ -51,7 +51,7 @@ export declare type CreateArrowStylesOptions = {
51
51
  * )
52
52
  * ```
53
53
  */
54
- export declare function createArrowStyles(options: CreateArrowStylesOptions): MakeStylesStyle;
54
+ export declare function createArrowStyles(options: CreateArrowStylesOptions): GriffelStyle;
55
55
  /**
56
56
  * Creates CSS styles to size the arrow created by createArrowStyles to the given height.
57
57
  *
@@ -1,4 +1,4 @@
1
- import { shorthands } from '@fluentui/react-make-styles';
1
+ import { shorthands } from '@griffel/react';
2
2
  import { tokens } from '@fluentui/react-theme';
3
3
  /**
4
4
  * Helper that creates a makeStyles rule for an arrow element.
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/createArrowStyles.ts"],"names":[],"mappings":"AAAA,SAAS,UAAT,QAA2B,6BAA3B;AACA,SAAS,MAAT,QAAuB,uBAAvB;AAqCA;;;;;;;;;;;;;;;;;;;;;AAqBG;;AACH,OAAM,SAAU,iBAAV,CAA4B,OAA5B,EAA6D;AACjE,QAAM;AACJ,IAAA,WADI;AAEJ,IAAA,WAAW,GAAG,KAFV;AAGJ,IAAA,WAAW,GAAG,OAHV;AAIJ,IAAA,WAAW,GAAG,MAAM,CAAC;AAJjB,MAKF,OALJ;AAOA,SAAO;AACL,IAAA,QAAQ,EAAE,UADL;AAEL,IAAA,eAAe,EAAE,SAFZ;AAGL,IAAA,UAAU,EAAE,QAHP;AAIL,IAAA,MAAM,EAAE,CAAC,CAJJ;AAML,QAAI,WAAW,IAAI,uBAAuB,CAAC,WAAD,CAA1C,CANK;AAQL,eAAW;AACT,MAAA,OAAO,EAAE,IADA;AAET,MAAA,UAAU,EAAE,SAFH;AAGT,MAAA,QAAQ,EAAE,UAHD;AAIT,MAAA,SAAS,EAAE,YAJF;AAKT,MAAA,KAAK,EAAE,SALE;AAMT,MAAA,MAAM,EAAE,SANC;AAOT,MAAA,eAAe,EAAE,SAPR;AAQT,SAAG,UAAU,CAAC,WAAX,CACD,GAAG,WAAW,gBADb,EAED,GAAG,WAAW,gBAFb,EAGD,GAAG,WAAW,gBAHb,CARM;AAaT,SAAG,UAAU,CAAC,YAAX,CAAwB,WAAxB,EAAqC,WAArC,EAAkD,WAAlD,CAbM;AAcT,MAAA,uBAAuB,EAAE,MAAM,CAAC,iBAdvB;AAeT,MAAA,SAAS,EAAE;AAfF,KARN;AA0BL;AACA,+CAA2C;AACzC,MAAA,MAAM,EAAE,IAAI,WAAW,EADkB;AAEzC,iBAAW;AAF8B,KA3BtC;AA+BL,iDAA6C;AAC3C,MAAA,IAAI,EAAE,IAAI,WAAW,gBADsB;AAE3C,iBAAW;AAFgC,KA/BxC;AAmCL,kDAA8C;AAC5C,MAAA,GAAG,EAAE,IAAI,WAAW,EADwB;AAE5C,iBAAW;AAFiC,KAnCzC;AAuCL,gDAA4C;AAC1C,MAAA,KAAK,EAAE,IAAI,WAAW,gBADoB;AAE1C,iBAAW;AAF+B;AAvCvC,GAAP;AA4CD;AAED;;;;;AAKG;;AACH,OAAM,SAAU,uBAAV,CAAkC,WAAlC,EAAqD;AACzD;AACA;AACA,QAAM,UAAU,GAAG,GAAG,QAAQ,WAAW,IAAzC;AACA,SAAO;AAAE,IAAA,KAAK,EAAE,UAAT;AAAqB,IAAA,MAAM,EAAE;AAA7B,GAAP;AACD","sourceRoot":""}
1
+ {"version":3,"sources":["createArrowStyles.ts"],"names":[],"mappings":"AAAA,SAAS,UAAT,QAA2B,gBAA3B;AACA,SAAS,MAAT,QAAuB,uBAAvB;AAqCA;;;;;;;;;;;;;;;;;;;;;AAqBG;;AACH,OAAM,SAAU,iBAAV,CAA4B,OAA5B,EAA6D;AACjE,QAAM;AACJ,IAAA,WADI;AAEJ,IAAA,WAAW,GAAG,KAFV;AAGJ,IAAA,WAAW,GAAG,OAHV;AAIJ,IAAA,WAAW,GAAG,MAAM,CAAC;AAJjB,MAKF,OALJ;AAOA,SAAO;AACL,IAAA,QAAQ,EAAE,UADL;AAEL,IAAA,eAAe,EAAE,SAFZ;AAGL,IAAA,UAAU,EAAE,QAHP;AAIL,IAAA,MAAM,EAAE,CAAC,CAJJ;AAML,QAAI,WAAW,IAAI,uBAAuB,CAAC,WAAD,CAA1C,CANK;AAQL,eAAW;AACT,MAAA,OAAO,EAAE,IADA;AAET,MAAA,UAAU,EAAE,SAFH;AAGT,MAAA,QAAQ,EAAE,UAHD;AAIT,MAAA,SAAS,EAAE,YAJF;AAKT,MAAA,KAAK,EAAE,SALE;AAMT,MAAA,MAAM,EAAE,SANC;AAOT,MAAA,eAAe,EAAE,SAPR;AAQT,SAAG,UAAU,CAAC,WAAX,CACD,GAAG,WAAW,gBADb,EAED,GAAG,WAAW,gBAFb,EAGD,GAAG,WAAW,gBAHb,CARM;AAaT,SAAG,UAAU,CAAC,YAAX,CAAwB,WAAxB,EAAqC,WAArC,EAAkD,WAAlD,CAbM;AAcT,MAAA,uBAAuB,EAAE,MAAM,CAAC,iBAdvB;AAeT,MAAA,SAAS,EAAE;AAfF,KARN;AA0BL;AACA,+CAA2C;AACzC,MAAA,MAAM,EAAE,IAAI,WAAW,EADkB;AAEzC,iBAAW;AAF8B,KA3BtC;AA+BL,iDAA6C;AAC3C,MAAA,IAAI,EAAE,IAAI,WAAW,gBADsB;AAE3C,iBAAW;AAFgC,KA/BxC;AAmCL,kDAA8C;AAC5C,MAAA,GAAG,EAAE,IAAI,WAAW,EADwB;AAE5C,iBAAW;AAFiC,KAnCzC;AAuCL,gDAA4C;AAC1C,MAAA,KAAK,EAAE,IAAI,WAAW,gBADoB;AAE1C,iBAAW;AAF+B;AAvCvC,GAAP;AA4CD;AAED;;;;;AAKG;;AACH,OAAM,SAAU,uBAAV,CAAkC,WAAlC,EAAqD;AACzD;AACA;AACA,QAAM,UAAU,GAAG,GAAG,QAAQ,WAAW,IAAzC;AACA,SAAO;AAAE,IAAA,KAAK,EAAE,UAAT;AAAqB,IAAA,MAAM,EAAE;AAA7B,GAAP;AACD","sourcesContent":["import { shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { GriffelStyle } from '@griffel/react';\n\n/**\n * Options parameter for the createArrowStyles function\n */\nexport type CreateArrowStylesOptions = {\n /**\n * The height of the arrow from the base to the tip, in px. The base width of the arrow is always twice its height.\n *\n * This can be undefined to leave out the arrow size styles. You must then add styles created by\n * createArrowHeightStyles to set the arrow's size correctly. This can be useful if the arrow can be different sizes.\n */\n arrowHeight: number | undefined;\n\n /**\n * The borderWidth of the arrow. Should be the same borderWidth as the parent element.\n *\n * @defaultvalue 1px\n */\n borderWidth?: GriffelStyle['borderBottomWidth'];\n\n /**\n * The borderStyle for the arrow. Should be the same borderStyle as the parent element.\n *\n * @defaultvalue solid\n */\n borderStyle?: GriffelStyle['borderBottomStyle'];\n\n /**\n * The borderColor of the arrow. Should be the same borderColor as the parent element.\n *\n * @defaultvalue tokens.colorTransparentStroke\n */\n borderColor?: GriffelStyle['borderBottomColor'];\n};\n\n/**\n * Helper that creates a makeStyles rule for an arrow element.\n * For runtime arrow size toggling simply create extra classnames to apply to the arrow element\n *\n * ```ts\n * makeStyles({\n * arrowWithSize: createArrowStyles({ arrowHeight: 6 }),\n *\n * arrowWithoutSize: createArrowStyles({ arrowHeight: undefined }),\n * mediumArrow: createArrowHeightStyles(4),\n * smallArrow: createArrowHeightStyles(2),\n * })\n * ...\n *\n * state.arrowWithSize.className = styles.arrowWithSize;\n * state.arrowWithoutSize.className = mergeClasses(\n * styles.arrowWithoutSize,\n * state.smallArrow && styles.smallArrow,\n * state.mediumArrow && styles.mediumArrow,\n * )\n * ```\n */\nexport function createArrowStyles(options: CreateArrowStylesOptions): GriffelStyle {\n const {\n arrowHeight,\n borderWidth = '1px',\n borderStyle = 'solid',\n borderColor = tokens.colorTransparentStroke,\n } = options;\n\n return {\n position: 'absolute',\n backgroundColor: 'inherit',\n visibility: 'hidden',\n zIndex: -1,\n\n ...(arrowHeight && createArrowHeightStyles(arrowHeight)),\n\n ':before': {\n content: '\"\"',\n visibility: 'visible',\n position: 'absolute',\n boxSizing: 'border-box',\n width: 'inherit',\n height: 'inherit',\n backgroundColor: 'inherit',\n ...shorthands.borderRight(\n `${borderWidth} /* @noflip */`,\n `${borderStyle} /* @noflip */`,\n `${borderColor} /* @noflip */`,\n ),\n ...shorthands.borderBottom(borderWidth, borderStyle, borderColor),\n borderBottomRightRadius: tokens.borderRadiusSmall,\n transform: 'rotate(var(--angle)) translate(0, 50%) rotate(45deg)',\n },\n\n // Popper sets data-popper-placement on the root element, which is used to align the arrow\n ':global([data-popper-placement^=\"top\"])': {\n bottom: `-${borderWidth}`,\n '--angle': '0',\n },\n ':global([data-popper-placement^=\"right\"])': {\n left: `-${borderWidth} /* @noflip */`,\n '--angle': '90deg',\n },\n ':global([data-popper-placement^=\"bottom\"])': {\n top: `-${borderWidth}`,\n '--angle': '180deg',\n },\n ':global([data-popper-placement^=\"left\"])': {\n right: `-${borderWidth} /* @noflip */`,\n '--angle': '270deg',\n },\n };\n}\n\n/**\n * Creates CSS styles to size the arrow created by createArrowStyles to the given height.\n *\n * Use this when you need to create classes for several different arrow sizes. If you only need a\n * constant arrow size, you can pass the `arrowHeight` param to createArrowStyles instead.\n */\nexport function createArrowHeightStyles(arrowHeight: number) {\n // The arrow is a square rotated 45 degrees to have its bottom and right edges form a right triangle.\n // Multiply the triangle's height by sqrt(2) to get length of its edges.\n const edgeLength = `${1.414 * arrowHeight}px`;\n return { width: edgeLength, height: edgeLength };\n}\n"],"sourceRoot":"../src/"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/createVirtualElementFromClick.ts"],"names":[],"mappings":"AAEA;;;AAGG;AACH,OAAM,SAAU,6BAAV,CAAwC,WAAxC,EAA+D;AACnE,QAAM,IAAI,GAAG,WAAW,CAAC,OAAzB;AACA,QAAM,GAAG,GAAG,WAAW,CAAC,OAAxB;AACA,QAAM,KAAK,GAAG,IAAI,GAAG,CAArB;AACA,QAAM,MAAM,GAAG,GAAG,GAAG,CAArB;;AAEA,WAAS,qBAAT,GAA8B;AAC5B,WAAO;AACL,MAAA,IADK;AAEL,MAAA,GAFK;AAGL,MAAA,KAHK;AAIL,MAAA,MAJK;AAML,MAAA,MAAM,EAAE,CANH;AAOL,MAAA,KAAK,EAAE;AAPF,KAAP;AASD;;AAED,SAAO;AACL,IAAA;AADK,GAAP;AAGD","sourceRoot":""}
1
+ {"version":3,"sources":["createVirtualElementFromClick.ts"],"names":[],"mappings":"AAEA;;;AAGG;AACH,OAAM,SAAU,6BAAV,CAAwC,WAAxC,EAA+D;AACnE,QAAM,IAAI,GAAG,WAAW,CAAC,OAAzB;AACA,QAAM,GAAG,GAAG,WAAW,CAAC,OAAxB;AACA,QAAM,KAAK,GAAG,IAAI,GAAG,CAArB;AACA,QAAM,MAAM,GAAG,GAAG,GAAG,CAArB;;AAEA,WAAS,qBAAT,GAA8B;AAC5B,WAAO;AACL,MAAA,IADK;AAEL,MAAA,GAFK;AAGL,MAAA,KAHK;AAIL,MAAA,MAJK;AAML,MAAA,MAAM,EAAE,CANH;AAOL,MAAA,KAAK,EAAE;AAPF,KAAP;AASD;;AAED,SAAO;AACL,IAAA;AADK,GAAP;AAGD","sourcesContent":["import type { PopperVirtualElement } from './types';\n\n/**\n * Creates a virtual element based on the position of a click event\n * Can be used as a target for popper in scenarios such as context menus\n */\nexport function createVirtualElementFromClick(nativeEvent: MouseEvent): PopperVirtualElement {\n const left = nativeEvent.clientX;\n const top = nativeEvent.clientY;\n const right = left + 1;\n const bottom = top + 1;\n\n function getBoundingClientRect(): ClientRect {\n return {\n left,\n top,\n right,\n bottom,\n\n height: 1,\n width: 1,\n };\n }\n\n return {\n getBoundingClientRect,\n };\n}\n"],"sourceRoot":"../src/"}
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,2BAA2B,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC9E,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,2BAA2B,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAC9E,cAAc,SAAS,CAAC","sourcesContent":["export * from './createVirtualElementFromClick';\nexport * from './createArrowStyles';\nexport * from './usePopper';\nexport * from './usePopperMouseTarget';\nexport { resolvePositioningShorthand, mergeArrowOffset } from './utils/index';\nexport * from './types';\n"]}
package/lib/types.d.ts CHANGED
@@ -12,18 +12,25 @@ export declare type Alignment = 'top' | 'bottom' | 'start' | 'end' | 'center';
12
12
  export declare type AutoSize = 'height' | 'height-always' | 'width' | 'width-always' | 'always' | boolean;
13
13
  export declare type Boundary = PopperJs.Boundary | 'scrollParent' | 'window';
14
14
  export declare type PopperRefHandle = {
15
+ /**
16
+ * Updates the position of the popper imperatively.
17
+ * Useful when the position of the target changes from other factors than scrolling of window resize.
18
+ */
15
19
  updatePosition: () => void;
20
+ /**
21
+ * Sets the target and updates positioning imperatively.
22
+ * Useful for avoiding double renders with the target option.
23
+ */
24
+ setTarget: (target: HTMLElement) => void;
16
25
  };
17
26
  export declare type PopperVirtualElement = PopperJs.VirtualElement;
18
- export interface PositioningProps {
27
+ export interface PopperOptions {
19
28
  /** Alignment for the component. Only has an effect if used with the @see position option */
20
29
  align?: Alignment;
21
30
  /** The element which will define the boundaries of the popper position for the flip behavior. */
22
31
  flipBoundary?: Boundary;
23
32
  /** The element which will define the boundaries of the popper position for the overflow behavior. */
24
33
  overflowBoundary?: Boundary;
25
- /** An imperative handle to Popper methods. */
26
- popperRef?: React.Ref<PopperRefHandle>;
27
34
  /**
28
35
  * Position for the component. Position has higher priority than align. If position is vertical ('above' | 'below')
29
36
  * and align is also vertical ('top' | 'bottom') or if both position and align are horizontal ('before' | 'after'
@@ -31,6 +38,11 @@ export interface PositioningProps {
31
38
  * then provided value for 'align' will be ignored and 'center' will be used instead.
32
39
  */
33
40
  position?: Position;
41
+ /**
42
+ * Enables the Popper box to position itself in 'fixed' mode (default value is position: 'absolute')
43
+ * @default false
44
+ */
45
+ positionFixed?: boolean;
34
46
  /**
35
47
  * Lets you displace a popper element from its reference element.
36
48
  * This can be useful if you need to apply some margin between them or if you need to fine tune the
@@ -50,10 +62,6 @@ export interface PositioningProps {
50
62
  * `height-always` applies `max-height` regardless of overflow, and 'width-always' for always applying `max-width`
51
63
  */
52
64
  autoSize?: AutoSize;
53
- /**
54
- * Manual override for popper target. Useful for scenarios where a component accepts user prop to override target
55
- */
56
- target?: HTMLElement | PopperVirtualElement | null;
57
65
  /**
58
66
  * Modifies position and alignment to cover the target
59
67
  */
@@ -63,6 +71,19 @@ export interface PositioningProps {
63
71
  * `position` props, regardless of the size of the component, the reference element or the viewport.
64
72
  */
65
73
  pinned?: boolean;
74
+ /**
75
+ * When the reference element or the viewport is outside viewport allows a popper element to be fully in viewport.
76
+ * "all" enables this behavior for all axis.
77
+ */
78
+ unstable_disableTether?: boolean | 'all';
79
+ }
80
+ export interface PositioningProps extends Omit<PopperOptions, 'positionFixed' | 'unstable_disableTether'> {
81
+ /** An imperative handle to Popper methods. */
82
+ popperRef?: React.Ref<PopperRefHandle>;
83
+ /**
84
+ * Manual override for popper target. Useful for scenarios where a component accepts user prop to override target
85
+ */
86
+ target?: HTMLElement | PopperVirtualElement | null;
66
87
  }
67
88
  export declare type PositioningShorthandValue = 'above' | 'above-start' | 'above-end' | 'below' | 'below-start' | 'below-end' | 'before' | 'before-top' | 'before-bottom' | 'after' | 'after-top' | 'after-bottom';
68
89
  export declare type PositioningShorthand = PositioningProps | PositioningShorthandValue;
package/lib/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"types.js","sourceRoot":"../src/","sources":["types.ts"],"names":[],"mappings":"","sourcesContent":["import * as PopperJs from '@popperjs/core';\nimport * as React from 'react';\n\nexport type OffsetFunctionParam = {\n popper: PopperJs.Rect;\n reference: PopperJs.Rect;\n placement: PopperJs.Placement;\n};\n\nexport type OffsetFunction = (param: OffsetFunctionParam) => [number | null | undefined, number | null | undefined];\n\nexport type Offset = OffsetFunction | [number | null | undefined, number | null | undefined];\n\nexport type Position = 'above' | 'below' | 'before' | 'after';\nexport type Alignment = 'top' | 'bottom' | 'start' | 'end' | 'center';\n\nexport type AutoSize = 'height' | 'height-always' | 'width' | 'width-always' | 'always' | boolean;\n\nexport type Boundary = PopperJs.Boundary | 'scrollParent' | 'window';\n\nexport type PopperRefHandle = {\n /**\n * Updates the position of the popper imperatively.\n * Useful when the position of the target changes from other factors than scrolling of window resize.\n */\n updatePosition: () => void;\n\n /**\n * Sets the target and updates positioning imperatively.\n * Useful for avoiding double renders with the target option.\n */\n setTarget: (target: HTMLElement) => void;\n};\n\nexport type PopperVirtualElement = PopperJs.VirtualElement;\n\nexport interface PopperOptions {\n /** Alignment for the component. Only has an effect if used with the @see position option */\n align?: Alignment;\n\n /** The element which will define the boundaries of the popper position for the flip behavior. */\n flipBoundary?: Boundary;\n\n /** The element which will define the boundaries of the popper position for the overflow behavior. */\n overflowBoundary?: Boundary;\n\n /**\n * Position for the component. Position has higher priority than align. If position is vertical ('above' | 'below')\n * and align is also vertical ('top' | 'bottom') or if both position and align are horizontal ('before' | 'after'\n * and 'start' | 'end' respectively),\n * then provided value for 'align' will be ignored and 'center' will be used instead.\n */\n position?: Position;\n\n /**\n * Enables the Popper box to position itself in 'fixed' mode (default value is position: 'absolute')\n * @default false\n */\n positionFixed?: boolean;\n\n /**\n * Lets you displace a popper element from its reference element.\n * This can be useful if you need to apply some margin between them or if you need to fine tune the\n * position according to some custom logic.\n */\n offset?: Offset;\n\n /**\n * Defines padding between the corner of the popup element and the arrow.\n * Use to prevent the arrow from overlapping a rounded corner, for example.\n */\n arrowPadding?: number;\n\n /**\n * Applies max-height and max-width on popper to fit it within the available space in viewport.\n * true enables this for both width and height when overflow happens.\n * 'always' applies `max-height`/`max-width` regardless of overflow.\n * 'height' applies `max-height` when overflow happens, and 'width' for `max-width`\n * `height-always` applies `max-height` regardless of overflow, and 'width-always' for always applying `max-width`\n */\n autoSize?: AutoSize;\n\n /**\n * Modifies position and alignment to cover the target\n */\n coverTarget?: boolean;\n\n /**\n * Disables automatic repositioning of the component; it will always be placed according to the values of `align` and\n * `position` props, regardless of the size of the component, the reference element or the viewport.\n */\n pinned?: boolean;\n\n /**\n * When the reference element or the viewport is outside viewport allows a popper element to be fully in viewport.\n * \"all\" enables this behavior for all axis.\n */\n // eslint-disable-next-line @typescript-eslint/naming-convention\n unstable_disableTether?: boolean | 'all';\n}\n\nexport interface PositioningProps\n // \"positionFixed\" & \"unstable_disableTether\" are not exported as public API (yet)\n extends Omit<PopperOptions, 'positionFixed' | 'unstable_disableTether'> {\n /** An imperative handle to Popper methods. */\n popperRef?: React.Ref<PopperRefHandle>;\n\n /**\n * Manual override for popper target. Useful for scenarios where a component accepts user prop to override target\n */\n target?: HTMLElement | PopperVirtualElement | null;\n}\n\nexport type PositioningShorthandValue =\n | 'above'\n | 'above-start'\n | 'above-end'\n | 'below'\n | 'below-start'\n | 'below-end'\n | 'before'\n | 'before-top'\n | 'before-bottom'\n | 'after'\n | 'after-top'\n | 'after-bottom';\n\nexport type PositioningShorthand = PositioningProps | PositioningShorthandValue;\n"]}
@@ -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>;