@fluentui/react-positioning 0.0.0-nightly-20220715-0418.1 → 0.0.0-nightly-20221007-1237.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 (121) hide show
  1. package/CHANGELOG.json +80 -10
  2. package/CHANGELOG.md +33 -8
  3. package/dist/index.d.ts +9 -16
  4. package/lib/constants.js +5 -0
  5. package/lib/constants.js.map +1 -0
  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/middleware/coverTarget.js +40 -0
  10. package/lib/middleware/coverTarget.js.map +1 -0
  11. package/lib/middleware/flip.js +19 -0
  12. package/lib/middleware/flip.js.map +1 -0
  13. package/lib/middleware/index.js +7 -0
  14. package/lib/middleware/index.js.map +1 -0
  15. package/lib/middleware/intersecting.js +21 -0
  16. package/lib/middleware/intersecting.js.map +1 -0
  17. package/lib/middleware/maxSize.js +43 -0
  18. package/lib/middleware/maxSize.js.map +1 -0
  19. package/lib/middleware/offset.js +11 -0
  20. package/lib/middleware/offset.js.map +1 -0
  21. package/lib/middleware/shift.js +30 -0
  22. package/lib/middleware/shift.js.map +1 -0
  23. package/lib/types.js.map +1 -1
  24. package/lib/usePositioning.js +234 -336
  25. package/lib/usePositioning.js.map +1 -1
  26. package/lib/usePositioningMouseTarget.js.map +1 -1
  27. package/lib/utils/debounce.js +22 -0
  28. package/lib/utils/debounce.js.map +1 -0
  29. package/lib/utils/fromFloatingUIPlacement.js +43 -0
  30. package/lib/utils/fromFloatingUIPlacement.js.map +1 -0
  31. package/lib/utils/getBoundary.js +5 -1
  32. package/lib/utils/getBoundary.js.map +1 -1
  33. package/lib/utils/getFloatingUIOffset.js +36 -0
  34. package/lib/utils/getFloatingUIOffset.js.map +1 -0
  35. package/lib/utils/getReactFiberFromNode.js.map +1 -1
  36. package/lib/utils/getScrollParent.js +6 -0
  37. package/lib/utils/getScrollParent.js.map +1 -1
  38. package/lib/utils/hasAutoFocusFilter.js +28 -0
  39. package/lib/utils/hasAutoFocusFilter.js.map +1 -0
  40. package/lib/utils/index.js +6 -2
  41. package/lib/utils/index.js.map +1 -1
  42. package/lib/utils/mergeArrowOffset.js +1 -1
  43. package/lib/utils/mergeArrowOffset.js.map +1 -1
  44. package/lib/utils/parseFloatingUIPlacement.js +14 -0
  45. package/lib/utils/parseFloatingUIPlacement.js.map +1 -0
  46. package/lib/utils/resolvePositioningShorthand.js.map +1 -1
  47. package/lib/utils/toFloatingUIPlacement.js +40 -0
  48. package/lib/utils/toFloatingUIPlacement.js.map +1 -0
  49. package/lib/utils/toggleScrollListener.js +24 -0
  50. package/lib/utils/toggleScrollListener.js.map +1 -0
  51. package/lib/utils/useCallbackRef.js.map +1 -1
  52. package/lib-commonjs/constants.js +11 -0
  53. package/lib-commonjs/constants.js.map +1 -0
  54. package/lib-commonjs/createArrowStyles.js.map +1 -1
  55. package/lib-commonjs/createVirtualElementFromClick.js.map +1 -1
  56. package/lib-commonjs/index.js.map +1 -1
  57. package/lib-commonjs/middleware/coverTarget.js +50 -0
  58. package/lib-commonjs/middleware/coverTarget.js.map +1 -0
  59. package/lib-commonjs/middleware/flip.js +30 -0
  60. package/lib-commonjs/middleware/flip.js.map +1 -0
  61. package/lib-commonjs/middleware/index.js +20 -0
  62. package/lib-commonjs/middleware/index.js.map +1 -0
  63. package/lib-commonjs/middleware/intersecting.js +31 -0
  64. package/lib-commonjs/middleware/intersecting.js.map +1 -0
  65. package/lib-commonjs/middleware/maxSize.js +54 -0
  66. package/lib-commonjs/middleware/maxSize.js.map +1 -0
  67. package/lib-commonjs/middleware/offset.js +22 -0
  68. package/lib-commonjs/middleware/offset.js.map +1 -0
  69. package/lib-commonjs/middleware/shift.js +41 -0
  70. package/lib-commonjs/middleware/shift.js.map +1 -0
  71. package/lib-commonjs/types.js.map +1 -1
  72. package/lib-commonjs/usePositioning.js +236 -337
  73. package/lib-commonjs/usePositioning.js.map +1 -1
  74. package/lib-commonjs/usePositioningMouseTarget.js.map +1 -1
  75. package/lib-commonjs/utils/debounce.js +31 -0
  76. package/lib-commonjs/utils/debounce.js.map +1 -0
  77. package/lib-commonjs/utils/fromFloatingUIPlacement.js +52 -0
  78. package/lib-commonjs/utils/fromFloatingUIPlacement.js.map +1 -0
  79. package/lib-commonjs/utils/getBoundary.js +5 -1
  80. package/lib-commonjs/utils/getBoundary.js.map +1 -1
  81. package/lib-commonjs/utils/getFloatingUIOffset.js +46 -0
  82. package/lib-commonjs/utils/getFloatingUIOffset.js.map +1 -0
  83. package/lib-commonjs/utils/getReactFiberFromNode.js.map +1 -1
  84. package/lib-commonjs/utils/getScrollParent.js +10 -1
  85. package/lib-commonjs/utils/getScrollParent.js.map +1 -1
  86. package/lib-commonjs/utils/hasAutoFocusFilter.js +37 -0
  87. package/lib-commonjs/utils/hasAutoFocusFilter.js.map +1 -0
  88. package/lib-commonjs/utils/index.js +10 -2
  89. package/lib-commonjs/utils/index.js.map +1 -1
  90. package/lib-commonjs/utils/mergeArrowOffset.js +1 -1
  91. package/lib-commonjs/utils/mergeArrowOffset.js.map +1 -1
  92. package/lib-commonjs/utils/parseFloatingUIPlacement.js +23 -0
  93. package/lib-commonjs/utils/parseFloatingUIPlacement.js.map +1 -0
  94. package/lib-commonjs/utils/resolvePositioningShorthand.js.map +1 -1
  95. package/lib-commonjs/utils/toFloatingUIPlacement.js +49 -0
  96. package/lib-commonjs/utils/toFloatingUIPlacement.js.map +1 -0
  97. package/lib-commonjs/utils/toggleScrollListener.js +34 -0
  98. package/lib-commonjs/utils/toggleScrollListener.js.map +1 -0
  99. package/lib-commonjs/utils/useCallbackRef.js.map +1 -1
  100. package/package.json +8 -12
  101. package/dist/tsdoc-metadata.json +0 -11
  102. package/lib/isIntersectingModifier.js +0 -26
  103. package/lib/isIntersectingModifier.js.map +0 -1
  104. package/lib/utils/fromPopperPlacement.js +0 -40
  105. package/lib/utils/fromPopperPlacement.js.map +0 -1
  106. package/lib/utils/getPopperOffset.js +0 -44
  107. package/lib/utils/getPopperOffset.js.map +0 -1
  108. package/lib/utils/parsePopperPlacement.js +0 -14
  109. package/lib/utils/parsePopperPlacement.js.map +0 -1
  110. package/lib/utils/positioningHelper.js +0 -49
  111. package/lib/utils/positioningHelper.js.map +0 -1
  112. package/lib-commonjs/isIntersectingModifier.js +0 -34
  113. package/lib-commonjs/isIntersectingModifier.js.map +0 -1
  114. package/lib-commonjs/utils/fromPopperPlacement.js +0 -50
  115. package/lib-commonjs/utils/fromPopperPlacement.js.map +0 -1
  116. package/lib-commonjs/utils/getPopperOffset.js +0 -54
  117. package/lib-commonjs/utils/getPopperOffset.js.map +0 -1
  118. package/lib-commonjs/utils/parsePopperPlacement.js +0 -23
  119. package/lib-commonjs/utils/parsePopperPlacement.js.map +0 -1
  120. package/lib-commonjs/utils/positioningHelper.js +0 -61
  121. package/lib-commonjs/utils/positioningHelper.js.map +0 -1
package/CHANGELOG.json CHANGED
@@ -2,13 +2,13 @@
2
2
  "name": "@fluentui/react-positioning",
3
3
  "entries": [
4
4
  {
5
- "date": "Fri, 15 Jul 2022 04:31:44 GMT",
6
- "tag": "@fluentui/react-positioning_v0.0.0-nightly-20220715-0418.1",
7
- "version": "0.0.0-nightly-20220715-0418.1",
5
+ "date": "Fri, 07 Oct 2022 12:44:23 GMT",
6
+ "tag": "@fluentui/react-positioning_v0.0.0-nightly-20221007-1237.1",
7
+ "version": "0.0.0-nightly-20221007-1237.1",
8
8
  "comments": {
9
9
  "prerelease": [
10
10
  {
11
- "author": "email not defined",
11
+ "author": "fluentui-internal@service.microsoft.com",
12
12
  "package": "@fluentui/react-positioning",
13
13
  "commit": "not available",
14
14
  "comment": "Release nightly v9"
@@ -16,20 +16,90 @@
16
16
  {
17
17
  "author": "beachball",
18
18
  "package": "@fluentui/react-positioning",
19
- "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20220715-0418.1",
20
- "commit": "e1949f7a18e758e415b4740eda5f84bb8ae19e02"
19
+ "comment": "Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20221007-1237.1",
20
+ "commit": "cb80d71825ddb9ebe5d06bb14b1c970f8633c4ec"
21
21
  },
22
22
  {
23
23
  "author": "beachball",
24
24
  "package": "@fluentui/react-positioning",
25
- "comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20220715-0418.1",
26
- "commit": "e1949f7a18e758e415b4740eda5f84bb8ae19e02"
25
+ "comment": "Bump @fluentui/react-theme to v0.0.0-nightly-20221007-1237.1",
26
+ "commit": "cb80d71825ddb9ebe5d06bb14b1c970f8633c4ec"
27
27
  },
28
28
  {
29
29
  "author": "beachball",
30
30
  "package": "@fluentui/react-positioning",
31
- "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20220715-0418.1",
32
- "commit": "e1949f7a18e758e415b4740eda5f84bb8ae19e02"
31
+ "comment": "Bump @fluentui/react-utilities to v0.0.0-nightly-20221007-1237.1",
32
+ "commit": "cb80d71825ddb9ebe5d06bb14b1c970f8633c4ec"
33
+ }
34
+ ]
35
+ }
36
+ },
37
+ {
38
+ "date": "Thu, 15 Sep 2022 09:49:16 GMT",
39
+ "tag": "@fluentui/react-positioning_v9.2.0",
40
+ "version": "9.2.0",
41
+ "comments": {
42
+ "minor": [
43
+ {
44
+ "author": "lingfangao@hotmail.com",
45
+ "package": "@fluentui/react-positioning",
46
+ "commit": "4ba03b2e704668cb253f8ad16e8995a8a44b3d22",
47
+ "comment": "feat: Upgrade to Floating UI v1"
48
+ },
49
+ {
50
+ "author": "beachball",
51
+ "package": "@fluentui/react-positioning",
52
+ "comment": "Bump @fluentui/react-shared-contexts to v9.0.1",
53
+ "commit": "a33448fe4a0f4117686c378f80b893d1406d95a8"
54
+ },
55
+ {
56
+ "author": "beachball",
57
+ "package": "@fluentui/react-positioning",
58
+ "comment": "Bump @fluentui/react-theme to v9.1.0",
59
+ "commit": "a33448fe4a0f4117686c378f80b893d1406d95a8"
60
+ },
61
+ {
62
+ "author": "beachball",
63
+ "package": "@fluentui/react-positioning",
64
+ "comment": "Bump @fluentui/react-utilities to v9.1.0",
65
+ "commit": "a33448fe4a0f4117686c378f80b893d1406d95a8"
66
+ }
67
+ ],
68
+ "none": [
69
+ {
70
+ "author": "martinhochel@microsoft.com",
71
+ "package": "@fluentui/react-positioning",
72
+ "commit": "16aa65dcae8f75c6a221225fd0eb43800650ac66",
73
+ "comment": "docs: re-generate api.md files"
74
+ },
75
+ {
76
+ "author": "martinhochel@microsoft.com",
77
+ "package": "@fluentui/react-positioning",
78
+ "commit": "e6cf183695d6d67a24e038c49a876224e5ed35e5",
79
+ "comment": "chore: update package scaffold"
80
+ }
81
+ ],
82
+ "patch": [
83
+ {
84
+ "author": "olfedias@microsoft.com",
85
+ "package": "@fluentui/react-positioning",
86
+ "commit": "e610024474cfe5d45f61501a8b6a21daf4c794a2",
87
+ "comment": "chore: Update Griffel to latest version"
88
+ }
89
+ ]
90
+ }
91
+ },
92
+ {
93
+ "date": "Wed, 03 Aug 2022 16:03:56 GMT",
94
+ "tag": "@fluentui/react-positioning_v9.1.2",
95
+ "version": "9.1.2",
96
+ "comments": {
97
+ "patch": [
98
+ {
99
+ "author": "miroslav.stastny@microsoft.com",
100
+ "package": "@fluentui/react-positioning",
101
+ "commit": "08563664778fd80284561d3c9d254307a0a32362",
102
+ "comment": "chore: Bump Griffel dependencies"
33
103
  }
34
104
  ]
35
105
  }
package/CHANGELOG.md CHANGED
@@ -1,20 +1,45 @@
1
1
  # Change Log - @fluentui/react-positioning
2
2
 
3
- This log was last generated on Fri, 15 Jul 2022 04:31:44 GMT and should not be manually modified.
3
+ This log was last generated on Fri, 07 Oct 2022 12:44:23 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [0.0.0-nightly-20220715-0418.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v0.0.0-nightly-20220715-0418.1)
7
+ ## [0.0.0-nightly-20221007-1237.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v0.0.0-nightly-20221007-1237.1)
8
8
 
9
- Fri, 15 Jul 2022 04:31:44 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.1.1..@fluentui/react-positioning_v0.0.0-nightly-20220715-0418.1)
9
+ Fri, 07 Oct 2022 12:44:23 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.2.0..@fluentui/react-positioning_v0.0.0-nightly-20221007-1237.1)
11
11
 
12
12
  ### Changes
13
13
 
14
- - Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by email not defined)
15
- - Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20220715-0418.1 ([commit](https://github.com/microsoft/fluentui/commit/e1949f7a18e758e415b4740eda5f84bb8ae19e02) by beachball)
16
- - Bump @fluentui/react-theme to v0.0.0-nightly-20220715-0418.1 ([commit](https://github.com/microsoft/fluentui/commit/e1949f7a18e758e415b4740eda5f84bb8ae19e02) by beachball)
17
- - Bump @fluentui/react-utilities to v0.0.0-nightly-20220715-0418.1 ([commit](https://github.com/microsoft/fluentui/commit/e1949f7a18e758e415b4740eda5f84bb8ae19e02) by beachball)
14
+ - Release nightly v9 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
15
+ - Bump @fluentui/react-shared-contexts to v0.0.0-nightly-20221007-1237.1 ([commit](https://github.com/microsoft/fluentui/commit/cb80d71825ddb9ebe5d06bb14b1c970f8633c4ec) by beachball)
16
+ - Bump @fluentui/react-theme to v0.0.0-nightly-20221007-1237.1 ([commit](https://github.com/microsoft/fluentui/commit/cb80d71825ddb9ebe5d06bb14b1c970f8633c4ec) by beachball)
17
+ - Bump @fluentui/react-utilities to v0.0.0-nightly-20221007-1237.1 ([commit](https://github.com/microsoft/fluentui/commit/cb80d71825ddb9ebe5d06bb14b1c970f8633c4ec) by beachball)
18
+
19
+ ## [9.2.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.2.0)
20
+
21
+ Thu, 15 Sep 2022 09:49:16 GMT
22
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.1.2..@fluentui/react-positioning_v9.2.0)
23
+
24
+ ### Minor changes
25
+
26
+ - feat: Upgrade to Floating UI v1 ([PR #24254](https://github.com/microsoft/fluentui/pull/24254) by lingfangao@hotmail.com)
27
+ - Bump @fluentui/react-shared-contexts to v9.0.1 ([PR #24808](https://github.com/microsoft/fluentui/pull/24808) by beachball)
28
+ - Bump @fluentui/react-theme to v9.1.0 ([PR #24808](https://github.com/microsoft/fluentui/pull/24808) by beachball)
29
+ - Bump @fluentui/react-utilities to v9.1.0 ([PR #24808](https://github.com/microsoft/fluentui/pull/24808) by beachball)
30
+
31
+ ### Patches
32
+
33
+ - chore: Update Griffel to latest version ([PR #24221](https://github.com/microsoft/fluentui/pull/24221) by olfedias@microsoft.com)
34
+
35
+ ## [9.1.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.1.2)
36
+
37
+ Wed, 03 Aug 2022 16:03:56 GMT
38
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.1.1..@fluentui/react-positioning_v9.1.2)
39
+
40
+ ### Patches
41
+
42
+ - chore: Bump Griffel dependencies ([PR #24114](https://github.com/microsoft/fluentui/pull/24114) by miroslav.stastny@microsoft.com)
18
43
 
19
44
  ## [9.1.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.1.1)
20
45
 
package/dist/index.d.ts CHANGED
@@ -83,10 +83,10 @@ export declare type CreateArrowStylesOptions = {
83
83
  export declare function createVirtualElementFromClick(nativeEvent: MouseEvent): PositioningVirtualElement;
84
84
 
85
85
  /**
86
- * @internal
87
86
  * Generally when adding an arrow to popper, it's necessary to offset the position of the popper by the
88
87
  * height of the arrow. A simple utility to merge a provided offset with an arrow height to return the final offset
89
88
  *
89
+ * @internal
90
90
  * @param userOffset - The offset provided by the user
91
91
  * @param arrowHeight - The height of the arrow in px
92
92
  * @returns User offset augmented with arrow height
@@ -216,24 +216,10 @@ declare type Rect = {
216
216
 
217
217
  export declare function resolvePositioningShorthand(shorthand: PositioningShorthand | undefined | null): Readonly<PositioningProps>;
218
218
 
219
- declare interface UsePopperOptions extends PositioningProps {
220
- /**
221
- * If false, delays Popper's creation.
222
- * @default true
223
- */
224
- enabled?: boolean;
225
- }
226
-
227
219
  /**
228
220
  * @internal
229
- * Exposes Popper positioning API via React hook. Contains few important differences between an official "react-popper"
230
- * package:
231
- * - style attributes are applied directly on DOM to avoid re-renders
232
- * - refs changes and resolution is handled properly without re-renders
233
- * - contains a specific to React fix related to initial positioning when containers have components with managed focus
234
- * to avoid focus jumps
235
221
  */
236
- export declare function usePositioning(options?: UsePopperOptions): {
222
+ export declare function usePositioning(options: UsePositioningOptions): {
237
223
  targetRef: React_2.MutableRefObject<any>;
238
224
  containerRef: React_2.MutableRefObject<any>;
239
225
  arrowRef: React_2.MutableRefObject<any>;
@@ -250,4 +236,11 @@ export declare function usePositioning(options?: UsePopperOptions): {
250
236
  */
251
237
  export declare const usePositioningMouseTarget: (initialState?: PositioningVirtualElement | (() => PositioningVirtualElement) | undefined) => readonly [PositioningVirtualElement | undefined, (event: React_2.MouseEvent | MouseEvent | undefined | null) => void];
252
238
 
239
+ declare interface UsePositioningOptions extends PositioningProps {
240
+ /**
241
+ * If false, does not position anything
242
+ */
243
+ enabled?: boolean;
244
+ }
245
+
253
246
  export { }
@@ -0,0 +1,5 @@
1
+ export const DATA_POSITIONING_INTERSECTING = 'data-popper-is-intersecting';
2
+ export const DATA_POSITIONING_ESCAPED = 'data-popper-escaped';
3
+ export const DATA_POSITIONING_HIDDEN = 'data-popper-reference-hidden';
4
+ export const DATA_POSITIONING_PLACEMENT = 'data-popper-placement';
5
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,6BAA6B,GAAG,6BAA6B,CAAC;AAC3E,MAAM,CAAC,MAAM,wBAAwB,GAAG,qBAAqB,CAAC;AAC9D,MAAM,CAAC,MAAM,uBAAuB,GAAG,8BAA8B,CAAC;AACtE,MAAM,CAAC,MAAM,0BAA0B,GAAG,uBAAuB,CAAC","sourcesContent":["export const DATA_POSITIONING_INTERSECTING = 'data-popper-is-intersecting';\nexport const DATA_POSITIONING_ESCAPED = 'data-popper-escaped';\nexport const DATA_POSITIONING_HIDDEN = 'data-popper-reference-hidden';\nexport const DATA_POSITIONING_PLACEMENT = 'data-popper-placement';\n"]}
@@ -1 +1 @@
1
- {"version":3,"sources":["createArrowStyles.ts"],"names":[],"mappings":"AAAA,SAAS,UAAT,QAA2B,gBAA3B;AACA,SAAS,MAAT,QAAuB,uBAAvB;AAsCA;;;;;;;;;;;;;;;;;;;;;;AAsBG;;AACH,OAAM,SAAU,iBAAV,CAA4B,OAA5B,EAA6D;EACjE,MAAM;IACJ,WADI;IAEJ,WAAW,GAAG,KAFV;IAGJ,WAAW,GAAG,OAHV;IAIJ,WAAW,GAAG,MAAM,CAAC;EAJjB,IAKF,OALJ;EAOA,OAAO;IACL,QAAQ,EAAE,UADL;IAEL,eAAe,EAAE,SAFZ;IAGL,UAAU,EAAE,QAHP;IAIL,MAAM,EAAE,CAAC,CAJJ;IAML,IAAI,WAAW,IAAI,uBAAuB,CAAC,WAAD,CAA1C,CANK;IAQL,YAAY;MACV,OAAO,EAAE,IADC;MAEV,UAAU,EAAE,SAFF;MAGV,QAAQ,EAAE,UAHA;MAIV,SAAS,EAAE,YAJD;MAKV,KAAK,EAAE,SALG;MAMV,MAAM,EAAE,SANE;MAOV,eAAe,EAAE,SAPP;MAQV,GAAG,UAAU,CAAC,WAAX,CACD,GAAG,WAAW,gBADb,EAED,GAAG,WAAW,gBAFb,EAGD,GAAG,WAAW,gBAHb,CARO;MAaV,GAAG,UAAU,CAAC,YAAX,CAAwB,WAAxB,EAAqC,WAArC,EAAkD,WAAlD,CAbO;MAcV,uBAAuB,EAAE,MAAM,CAAC,iBAdtB;MAeV,SAAS,EAAE;IAfD,CARP;IA0BL;IACA,2CAA2C;MACzC,MAAM,EAAE,IAAI,WAAW,EADkB;MAEzC,WAAW;IAF8B,CA3BtC;IA+BL,6CAA6C;MAC3C,IAAI,EAAE,IAAI,WAAW,gBADsB;MAE3C,WAAW;IAFgC,CA/BxC;IAmCL,8CAA8C;MAC5C,GAAG,EAAE,IAAI,WAAW,EADwB;MAE5C,WAAW;IAFiC,CAnCzC;IAuCL,4CAA4C;MAC1C,KAAK,EAAE,IAAI,WAAW,gBADoB;MAE1C,WAAW;IAF+B;EAvCvC,CAAP;AA4CD;AAED;;;;;;AAMG;;AACH,OAAM,SAAU,uBAAV,CAAkC,WAAlC,EAAqD;EACzD;EACA;EACA,MAAM,UAAU,GAAG,GAAG,QAAQ,WAAW,IAAzC;EACA,OAAO;IAAE,KAAK,EAAE,UAAT;IAAqB,MAAM,EAAE;EAA7B,CAAP;AACD","sourcesContent":["import { shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { GriffelStyle } from '@griffel/react';\n\n/**\n * @internal\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 * @internal\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 * @internal\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
+ {"version":3,"sources":["../src/createArrowStyles.ts"],"names":[],"mappings":"AAAA,SAAS,UAAT,QAA2B,gBAA3B;AACA,SAAS,MAAT,QAAuB,uBAAvB;AAsCA;;;;;;;;;;;;;;;;;;;;;;AAsBG;;AACH,OAAM,SAAU,iBAAV,CAA4B,OAA5B,EAA6D;EACjE,MAAM;IACJ,WADI;IAEJ,WAAW,GAAG,KAFV;IAGJ,WAAW,GAAG,OAHV;IAIJ,WAAW,GAAG,MAAM,CAAC;EAJjB,IAKF,OALJ;EAOA,OAAO;IACL,QAAQ,EAAE,UADL;IAEL,eAAe,EAAE,SAFZ;IAGL,UAAU,EAAE,QAHP;IAIL,MAAM,EAAE,CAAC,CAJJ;IAML,IAAI,WAAW,IAAI,uBAAuB,CAAC,WAAD,CAA1C,CANK;IAQL,YAAY;MACV,OAAO,EAAE,IADC;MAEV,UAAU,EAAE,SAFF;MAGV,QAAQ,EAAE,UAHA;MAIV,SAAS,EAAE,YAJD;MAKV,KAAK,EAAE,SALG;MAMV,MAAM,EAAE,SANE;MAOV,eAAe,EAAE,SAPP;MAQV,GAAG,UAAU,CAAC,WAAX,CACD,GAAG,WAAW,gBADb,EAED,GAAG,WAAW,gBAFb,EAGD,GAAG,WAAW,gBAHb,CARO;MAaV,GAAG,UAAU,CAAC,YAAX,CAAwB,WAAxB,EAAqC,WAArC,EAAkD,WAAlD,CAbO;MAcV,uBAAuB,EAAE,MAAM,CAAC,iBAdtB;MAeV,SAAS,EAAE;IAfD,CARP;IA0BL;IACA,2CAA2C;MACzC,MAAM,EAAE,IAAI,WAAW,EADkB;MAEzC,WAAW;IAF8B,CA3BtC;IA+BL,6CAA6C;MAC3C,IAAI,EAAE,IAAI,WAAW,gBADsB;MAE3C,WAAW;IAFgC,CA/BxC;IAmCL,8CAA8C;MAC5C,GAAG,EAAE,IAAI,WAAW,EADwB;MAE5C,WAAW;IAFiC,CAnCzC;IAuCL,4CAA4C;MAC1C,KAAK,EAAE,IAAI,WAAW,gBADoB;MAE1C,WAAW;IAF+B;EAvCvC,CAAP;AA4CD;AAED;;;;;;AAMG;;AACH,OAAM,SAAU,uBAAV,CAAkC,WAAlC,EAAqD;EACzD;EACA;EACA,MAAM,UAAU,GAAG,GAAG,QAAQ,WAAW,IAAzC;EACA,OAAO;IAAE,KAAK,EAAE,UAAT;IAAqB,MAAM,EAAE;EAA7B,CAAP;AACD","sourcesContent":["import { shorthands } from '@griffel/react';\nimport { tokens } from '@fluentui/react-theme';\nimport type { GriffelStyle } from '@griffel/react';\n\n/**\n * @internal\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 * @internal\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 * @internal\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":""}
@@ -1 +1 @@
1
- {"version":3,"sources":["createVirtualElementFromClick.ts"],"names":[],"mappings":"AAEA;;;AAGG;AACH,OAAM,SAAU,6BAAV,CAAwC,WAAxC,EAA+D;EACnE,MAAM,IAAI,GAAG,WAAW,CAAC,OAAzB;EACA,MAAM,GAAG,GAAG,WAAW,CAAC,OAAxB;EACA,MAAM,KAAK,GAAG,IAAI,GAAG,CAArB;EACA,MAAM,MAAM,GAAG,GAAG,GAAG,CAArB;;EAEA,SAAS,qBAAT,GAA8B;IAC5B,OAAO;MACL,IADK;MAEL,GAFK;MAGL,KAHK;MAIL,MAJK;MAKL,CAAC,EAAE,IALE;MAML,CAAC,EAAE,GANE;MAOL,MAAM,EAAE,CAPH;MAQL,KAAK,EAAE;IARF,CAAP;EAUD;;EAED,OAAO;IACL;EADK,CAAP;AAGD","sourcesContent":["import type { PositioningVirtualElement } 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): PositioningVirtualElement {\n const left = nativeEvent.clientX;\n const top = nativeEvent.clientY;\n const right = left + 1;\n const bottom = top + 1;\n\n function getBoundingClientRect() {\n return {\n left,\n top,\n right,\n bottom,\n x: left,\n y: top,\n height: 1,\n width: 1,\n };\n }\n\n return {\n getBoundingClientRect,\n };\n}\n"],"sourceRoot":"../src/"}
1
+ {"version":3,"sources":["../src/createVirtualElementFromClick.ts"],"names":[],"mappings":"AAEA;;;AAGG;AACH,OAAM,SAAU,6BAAV,CAAwC,WAAxC,EAA+D;EACnE,MAAM,IAAI,GAAG,WAAW,CAAC,OAAzB;EACA,MAAM,GAAG,GAAG,WAAW,CAAC,OAAxB;EACA,MAAM,KAAK,GAAG,IAAI,GAAG,CAArB;EACA,MAAM,MAAM,GAAG,GAAG,GAAG,CAArB;;EAEA,SAAS,qBAAT,GAA8B;IAC5B,OAAO;MACL,IADK;MAEL,GAFK;MAGL,KAHK;MAIL,MAJK;MAKL,CAAC,EAAE,IALE;MAML,CAAC,EAAE,GANE;MAOL,MAAM,EAAE,CAPH;MAQL,KAAK,EAAE;IARF,CAAP;EAUD;;EAED,OAAO;IACL;EADK,CAAP;AAGD","sourcesContent":["import type { PositioningVirtualElement } 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): PositioningVirtualElement {\n const left = nativeEvent.clientX;\n const top = nativeEvent.clientY;\n const right = left + 1;\n const bottom = top + 1;\n\n function getBoundingClientRect() {\n return {\n left,\n top,\n right,\n bottom,\n x: left,\n y: top,\n height: 1,\n width: 1,\n };\n }\n\n return {\n getBoundingClientRect,\n };\n}\n"],"sourceRoot":""}
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"../src/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAEjF,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,2BAA2B,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC","sourcesContent":["export { createVirtualElementFromClick } from './createVirtualElementFromClick';\nexport { createArrowHeightStyles, createArrowStyles } from './createArrowStyles';\nexport type { CreateArrowStylesOptions } from './createArrowStyles';\nexport { usePositioning } from './usePositioning';\nexport { usePositioningMouseTarget } from './usePositioningMouseTarget';\nexport { resolvePositioningShorthand, mergeArrowOffset } from './utils/index';\nexport type {\n Alignment,\n AutoSize,\n Boundary,\n Offset,\n OffsetFunction,\n OffsetFunctionParam,\n OffsetObject,\n OffsetShorthand,\n Position,\n PositioningImperativeRef,\n PositioningProps,\n PositioningShorthand,\n PositioningShorthandValue,\n PositioningVirtualElement,\n} from './types';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChF,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAEjF,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,2BAA2B,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC","sourcesContent":["export { createVirtualElementFromClick } from './createVirtualElementFromClick';\nexport { createArrowHeightStyles, createArrowStyles } from './createArrowStyles';\nexport type { CreateArrowStylesOptions } from './createArrowStyles';\nexport { usePositioning } from './usePositioning';\nexport { usePositioningMouseTarget } from './usePositioningMouseTarget';\nexport { resolvePositioningShorthand, mergeArrowOffset } from './utils/index';\nexport type {\n Alignment,\n AutoSize,\n Boundary,\n Offset,\n OffsetFunction,\n OffsetFunctionParam,\n OffsetObject,\n OffsetShorthand,\n Position,\n PositioningImperativeRef,\n PositioningProps,\n PositioningShorthand,\n PositioningShorthandValue,\n PositioningVirtualElement,\n} from './types';\n"]}
@@ -0,0 +1,40 @@
1
+ import { parseFloatingUIPlacement } from '../utils/index';
2
+ export function coverTarget() {
3
+ return {
4
+ name: 'coverTarget',
5
+ fn: middlewareArguments => {
6
+ const {
7
+ placement,
8
+ rects,
9
+ x,
10
+ y
11
+ } = middlewareArguments;
12
+ const basePlacement = parseFloatingUIPlacement(placement).side;
13
+ const newCoords = {
14
+ x,
15
+ y
16
+ };
17
+
18
+ switch (basePlacement) {
19
+ case 'bottom':
20
+ newCoords.y -= rects.reference.height;
21
+ break;
22
+
23
+ case 'top':
24
+ newCoords.y += rects.reference.height;
25
+ break;
26
+
27
+ case 'left':
28
+ newCoords.x += rects.reference.width;
29
+ break;
30
+
31
+ case 'right':
32
+ newCoords.x -= rects.reference.width;
33
+ break;
34
+ }
35
+
36
+ return newCoords;
37
+ }
38
+ };
39
+ }
40
+ //# sourceMappingURL=coverTarget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/middleware/coverTarget.ts"],"names":[],"mappings":"AACA,SAAS,wBAAT,QAAyC,gBAAzC;AAEA,OAAM,SAAU,WAAV,GAAqB;EACzB,OAAO;IACL,IAAI,EAAE,aADD;IAEL,EAAE,EAAE,mBAAmB,IAAG;MACxB,MAAM;QAAE,SAAF;QAAa,KAAb;QAAoB,CAApB;QAAuB;MAAvB,IAA6B,mBAAnC;MACA,MAAM,aAAa,GAAG,wBAAwB,CAAC,SAAD,CAAxB,CAAoC,IAA1D;MACA,MAAM,SAAS,GAAG;QAAE,CAAF;QAAK;MAAL,CAAlB;;MAEA,QAAQ,aAAR;QACE,KAAK,QAAL;UACE,SAAS,CAAC,CAAV,IAAe,KAAK,CAAC,SAAN,CAAgB,MAA/B;UACA;;QACF,KAAK,KAAL;UACE,SAAS,CAAC,CAAV,IAAe,KAAK,CAAC,SAAN,CAAgB,MAA/B;UACA;;QACF,KAAK,MAAL;UACE,SAAS,CAAC,CAAV,IAAe,KAAK,CAAC,SAAN,CAAgB,KAA/B;UACA;;QACF,KAAK,OAAL;UACE,SAAS,CAAC,CAAV,IAAe,KAAK,CAAC,SAAN,CAAgB,KAA/B;UACA;MAZJ;;MAeA,OAAO,SAAP;IACD;EAvBI,CAAP;AAyBD","sourcesContent":["import type { Middleware } from '@floating-ui/dom';\nimport { parseFloatingUIPlacement } from '../utils/index';\n\nexport function coverTarget(): Middleware {\n return {\n name: 'coverTarget',\n fn: middlewareArguments => {\n const { placement, rects, x, y } = middlewareArguments;\n const basePlacement = parseFloatingUIPlacement(placement).side;\n const newCoords = { x, y };\n\n switch (basePlacement) {\n case 'bottom':\n newCoords.y -= rects.reference.height;\n break;\n case 'top':\n newCoords.y += rects.reference.height;\n break;\n case 'left':\n newCoords.x += rects.reference.width;\n break;\n case 'right':\n newCoords.x -= rects.reference.width;\n break;\n }\n\n return newCoords;\n },\n };\n}\n"],"sourceRoot":""}
@@ -0,0 +1,19 @@
1
+ import { flip as baseFlip } from '@floating-ui/dom';
2
+ import { getBoundary } from '../utils/index';
3
+ export function flip(options) {
4
+ const {
5
+ hasScrollableElement,
6
+ flipBoundary,
7
+ container
8
+ } = options;
9
+ return baseFlip({ ...(hasScrollableElement && {
10
+ boundary: 'clippingAncestors'
11
+ }),
12
+ ...(flipBoundary && {
13
+ altBoundary: true,
14
+ boundary: getBoundary(container, flipBoundary)
15
+ }),
16
+ fallbackStrategy: 'bestFit'
17
+ });
18
+ }
19
+ //# sourceMappingURL=flip.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/middleware/flip.ts"],"names":[],"mappings":"AAAA,SAAS,IAAI,IAAI,QAAjB,QAAiC,kBAAjC;AAEA,SAAS,WAAT,QAA4B,gBAA5B;AAOA,OAAM,SAAU,IAAV,CAAe,OAAf,EAA6C;EACjD,MAAM;IAAE,oBAAF;IAAwB,YAAxB;IAAsC;EAAtC,IAAoD,OAA1D;EAEA,OAAO,QAAQ,CAAC,EACd,IAAI,oBAAoB,IAAI;MAAE,QAAQ,EAAE;IAAZ,CAA5B,CADc;IAEd,IAAI,YAAY,IAAI;MAAE,WAAW,EAAE,IAAf;MAAqB,QAAQ,EAAE,WAAW,CAAC,SAAD,EAAY,YAAZ;IAA1C,CAApB,CAFc;IAGd,gBAAgB,EAAE;EAHJ,CAAD,CAAf;AAKD","sourcesContent":["import { flip as baseFlip } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\nimport { getBoundary } from '../utils/index';\n\nexport interface FlipMiddlewareOptions extends Pick<PositioningOptions, 'flipBoundary'> {\n hasScrollableElement?: boolean;\n container: HTMLElement | null;\n}\n\nexport function flip(options: FlipMiddlewareOptions) {\n const { hasScrollableElement, flipBoundary, container } = options;\n\n return baseFlip({\n ...(hasScrollableElement && { boundary: 'clippingAncestors' }),\n ...(flipBoundary && { altBoundary: true, boundary: getBoundary(container, flipBoundary) }),\n fallbackStrategy: 'bestFit',\n });\n}\n"],"sourceRoot":""}
@@ -0,0 +1,7 @@
1
+ export * from './coverTarget';
2
+ export * from './flip';
3
+ export * from './intersecting';
4
+ export * from './maxSize';
5
+ export * from './offset';
6
+ export * from './shift';
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/middleware/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC","sourcesContent":["export * from './coverTarget';\nexport * from './flip';\nexport * from './intersecting';\nexport * from './maxSize';\nexport * from './offset';\nexport * from './shift';\n"]}
@@ -0,0 +1,21 @@
1
+ import { detectOverflow } from '@floating-ui/dom';
2
+ export function intersecting() {
3
+ return {
4
+ name: 'intersectionObserver',
5
+ fn: async middlewareArguments => {
6
+ const floatingRect = middlewareArguments.rects.floating;
7
+ const altOverflow = await detectOverflow(middlewareArguments, {
8
+ altBoundary: true
9
+ });
10
+ const isIntersectingTop = altOverflow.top < floatingRect.height && altOverflow.top > 0;
11
+ const isIntersectingBottom = altOverflow.bottom < floatingRect.height && altOverflow.bottom > 0;
12
+ const isIntersecting = isIntersectingTop || isIntersectingBottom;
13
+ return {
14
+ data: {
15
+ intersecting: isIntersecting
16
+ }
17
+ };
18
+ }
19
+ };
20
+ }
21
+ //# sourceMappingURL=intersecting.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/middleware/intersecting.ts"],"names":[],"mappings":"AACA,SAAS,cAAT,QAA+B,kBAA/B;AAEA,OAAM,SAAU,YAAV,GAAsB;EAC1B,OAAO;IACL,IAAI,EAAE,sBADD;IAEL,EAAE,EAAE,MAAM,mBAAN,IAA4B;MAC9B,MAAM,YAAY,GAAG,mBAAmB,CAAC,KAApB,CAA0B,QAA/C;MACA,MAAM,WAAW,GAAG,MAAM,cAAc,CAAC,mBAAD,EAAsB;QAAE,WAAW,EAAE;MAAf,CAAtB,CAAxC;MAEA,MAAM,iBAAiB,GAAG,WAAW,CAAC,GAAZ,GAAkB,YAAY,CAAC,MAA/B,IAAyC,WAAW,CAAC,GAAZ,GAAkB,CAArF;MACA,MAAM,oBAAoB,GAAG,WAAW,CAAC,MAAZ,GAAqB,YAAY,CAAC,MAAlC,IAA4C,WAAW,CAAC,MAAZ,GAAqB,CAA9F;MAEA,MAAM,cAAc,GAAG,iBAAiB,IAAI,oBAA5C;MAEA,OAAO;QACL,IAAI,EAAE;UACJ,YAAY,EAAE;QADV;MADD,CAAP;IAKD;EAhBI,CAAP;AAkBD","sourcesContent":["import type { Middleware } from '@floating-ui/dom';\nimport { detectOverflow } from '@floating-ui/dom';\n\nexport function intersecting(): Middleware {\n return {\n name: 'intersectionObserver',\n fn: async middlewareArguments => {\n const floatingRect = middlewareArguments.rects.floating;\n const altOverflow = await detectOverflow(middlewareArguments, { altBoundary: true });\n\n const isIntersectingTop = altOverflow.top < floatingRect.height && altOverflow.top > 0;\n const isIntersectingBottom = altOverflow.bottom < floatingRect.height && altOverflow.bottom > 0;\n\n const isIntersecting = isIntersectingTop || isIntersectingBottom;\n\n return {\n data: {\n intersecting: isIntersecting,\n },\n };\n },\n };\n}\n"],"sourceRoot":""}
@@ -0,0 +1,43 @@
1
+ import { detectOverflow } from '@floating-ui/dom';
2
+ import { parseFloatingUIPlacement } from '../utils/index';
3
+ export function maxSize(autoSize) {
4
+ return {
5
+ name: 'maxSize',
6
+ fn: async middlewareArguments => {
7
+ const {
8
+ placement,
9
+ rects,
10
+ elements,
11
+ middlewareData
12
+ } = middlewareArguments;
13
+ const basePlacement = parseFloatingUIPlacement(placement).side;
14
+ const overflow = await detectOverflow(middlewareArguments);
15
+ const {
16
+ x,
17
+ y
18
+ } = middlewareData.shift || {
19
+ x: 0,
20
+ y: 0
21
+ };
22
+ const {
23
+ width,
24
+ height
25
+ } = rects.floating;
26
+ const widthProp = basePlacement === 'left' ? 'left' : 'right';
27
+ const heightProp = basePlacement === 'top' ? 'top' : 'bottom';
28
+ const applyMaxWidth = autoSize === 'always' || autoSize === 'width-always' || overflow[widthProp] > 0 && (autoSize === true || autoSize === 'width');
29
+ const applyMaxHeight = autoSize === 'always' || autoSize === 'height-always' || overflow[heightProp] > 0 && (autoSize === true || autoSize === 'height');
30
+
31
+ if (applyMaxWidth) {
32
+ elements.floating.style.maxWidth = `${width - overflow[widthProp] - x}px`;
33
+ }
34
+
35
+ if (applyMaxHeight) {
36
+ elements.floating.style.maxHeight = `${height - overflow[heightProp] - y}px`;
37
+ }
38
+
39
+ return {};
40
+ }
41
+ };
42
+ }
43
+ //# sourceMappingURL=maxSize.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/middleware/maxSize.ts"],"names":[],"mappings":"AAAA,SAAS,cAAT,QAA+B,kBAA/B;AAGA,SAAS,wBAAT,QAAyC,gBAAzC;AAEA,OAAM,SAAU,OAAV,CAAkB,QAAlB,EAA0D;EAC9D,OAAO;IACL,IAAI,EAAE,SADD;IAEL,EAAE,EAAE,MAAM,mBAAN,IAA4B;MAC9B,MAAM;QAAE,SAAF;QAAa,KAAb;QAAoB,QAApB;QAA8B;MAA9B,IAAiD,mBAAvD;MACA,MAAM,aAAa,GAAG,wBAAwB,CAAC,SAAD,CAAxB,CAAoC,IAA1D;MAEA,MAAM,QAAQ,GAAG,MAAM,cAAc,CAAC,mBAAD,CAArC;MACA,MAAM;QAAE,CAAF;QAAK;MAAL,IAAW,cAAc,CAAC,KAAf,IAAwB;QAAE,CAAC,EAAE,CAAL;QAAQ,CAAC,EAAE;MAAX,CAAzC;MACA,MAAM;QAAE,KAAF;QAAS;MAAT,IAAoB,KAAK,CAAC,QAAhC;MAEA,MAAM,SAAS,GAAS,aAAa,KAAK,MAAlB,GAA2B,MAA3B,GAAoC,OAA5D;MACA,MAAM,UAAU,GAAS,aAAa,KAAK,KAAlB,GAA0B,KAA1B,GAAkC,QAA3D;MAEA,MAAM,aAAa,GACjB,QAAQ,KAAK,QAAb,IACA,QAAQ,KAAK,cADb,IAEC,QAAQ,CAAC,SAAD,CAAR,GAAsB,CAAtB,KAA4B,QAAQ,KAAK,IAAb,IAAqB,QAAQ,KAAK,OAA9D,CAHH;MAIA,MAAM,cAAc,GAClB,QAAQ,KAAK,QAAb,IACA,QAAQ,KAAK,eADb,IAEC,QAAQ,CAAC,UAAD,CAAR,GAAuB,CAAvB,KAA6B,QAAQ,KAAK,IAAb,IAAqB,QAAQ,KAAK,QAA/D,CAHH;;MAKA,IAAI,aAAJ,EAAmB;QACjB,QAAQ,CAAC,QAAT,CAAkB,KAAlB,CAAwB,QAAxB,GAAmC,GAAG,KAAK,GAAG,QAAQ,CAAC,SAAD,CAAhB,GAA8B,CAAC,IAArE;MACD;;MACD,IAAI,cAAJ,EAAoB;QAClB,QAAQ,CAAC,QAAT,CAAkB,KAAlB,CAAwB,SAAxB,GAAoC,GAAG,MAAM,GAAG,QAAQ,CAAC,UAAD,CAAjB,GAAgC,CAAC,IAAxE;MACD;;MAED,OAAO,EAAP;IACD;EA9BI,CAAP;AAgCD","sourcesContent":["import { detectOverflow } from '@floating-ui/dom';\nimport type { Middleware, Side } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\nimport { parseFloatingUIPlacement } from '../utils/index';\n\nexport function maxSize(autoSize: PositioningOptions['autoSize']): Middleware {\n return {\n name: 'maxSize',\n fn: async middlewareArguments => {\n const { placement, rects, elements, middlewareData } = middlewareArguments;\n const basePlacement = parseFloatingUIPlacement(placement).side;\n\n const overflow = await detectOverflow(middlewareArguments);\n const { x, y } = middlewareData.shift || { x: 0, y: 0 };\n const { width, height } = rects.floating;\n\n const widthProp: Side = basePlacement === 'left' ? 'left' : 'right';\n const heightProp: Side = basePlacement === 'top' ? 'top' : 'bottom';\n\n const applyMaxWidth =\n autoSize === 'always' ||\n autoSize === 'width-always' ||\n (overflow[widthProp] > 0 && (autoSize === true || autoSize === 'width'));\n const applyMaxHeight =\n autoSize === 'always' ||\n autoSize === 'height-always' ||\n (overflow[heightProp] > 0 && (autoSize === true || autoSize === 'height'));\n\n if (applyMaxWidth) {\n elements.floating.style.maxWidth = `${width - overflow[widthProp] - x}px`;\n }\n if (applyMaxHeight) {\n elements.floating.style.maxHeight = `${height - overflow[heightProp] - y}px`;\n }\n\n return {};\n },\n };\n}\n"],"sourceRoot":""}
@@ -0,0 +1,11 @@
1
+ import { offset as baseOffset } from '@floating-ui/dom';
2
+ import { getFloatingUIOffset } from '../utils/getFloatingUIOffset';
3
+ /**
4
+ * Wraps floating UI offset middleware to to transform offset value
5
+ */
6
+
7
+ export function offset(offsetValue) {
8
+ const floatingUIOffset = getFloatingUIOffset(offsetValue);
9
+ return baseOffset(floatingUIOffset);
10
+ }
11
+ //# sourceMappingURL=offset.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/middleware/offset.ts"],"names":[],"mappings":"AAAA,SAAS,MAAM,IAAI,UAAnB,QAAqC,kBAArC;AAEA,SAAS,mBAAT,QAAoC,8BAApC;AAEA;;AAEG;;AACH,OAAM,SAAU,MAAV,CAAiB,WAAjB,EAA0D;EAC9D,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,WAAD,CAA5C;EACA,OAAO,UAAU,CAAC,gBAAD,CAAjB;AACD","sourcesContent":["import { offset as baseOffset } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\nimport { getFloatingUIOffset } from '../utils/getFloatingUIOffset';\n\n/**\n * Wraps floating UI offset middleware to to transform offset value\n */\nexport function offset(offsetValue: PositioningOptions['offset']) {\n const floatingUIOffset = getFloatingUIOffset(offsetValue);\n return baseOffset(floatingUIOffset);\n}\n"],"sourceRoot":""}
@@ -0,0 +1,30 @@
1
+ import { shift as baseShift, limitShift } from '@floating-ui/dom';
2
+ import { getBoundary } from '../utils/index';
3
+ /**
4
+ * Wraps the floating UI shift middleware for easier usage of our options
5
+ */
6
+
7
+ export function shift(options) {
8
+ const {
9
+ hasScrollableElement,
10
+ disableTether,
11
+ overflowBoundary,
12
+ container
13
+ } = options;
14
+ return baseShift({ ...(hasScrollableElement && {
15
+ boundary: 'clippingAncestors'
16
+ }),
17
+ ...(disableTether && {
18
+ crossAxis: disableTether === 'all',
19
+ limiter: limitShift({
20
+ crossAxis: disableTether !== 'all',
21
+ mainAxis: false
22
+ })
23
+ }),
24
+ ...(overflowBoundary && {
25
+ altBoundary: true,
26
+ boundary: getBoundary(container, overflowBoundary)
27
+ })
28
+ });
29
+ }
30
+ //# sourceMappingURL=shift.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/middleware/shift.ts"],"names":[],"mappings":"AAAA,SAAS,KAAK,IAAI,SAAlB,EAA6B,UAA7B,QAA+C,kBAA/C;AAEA,SAAS,WAAT,QAA4B,gBAA5B;AAQA;;AAEG;;AACH,OAAM,SAAU,KAAV,CAAgB,OAAhB,EAA+C;EACnD,MAAM;IAAE,oBAAF;IAAwB,aAAxB;IAAuC,gBAAvC;IAAyD;EAAzD,IAAuE,OAA7E;EAEA,OAAO,SAAS,CAAC,EACf,IAAI,oBAAoB,IAAI;MAAE,QAAQ,EAAE;IAAZ,CAA5B,CADe;IAEf,IAAI,aAAa,IAAI;MACnB,SAAS,EAAE,aAAa,KAAK,KADV;MAEnB,OAAO,EAAE,UAAU,CAAC;QAAE,SAAS,EAAE,aAAa,KAAK,KAA/B;QAAsC,QAAQ,EAAE;MAAhD,CAAD;IAFA,CAArB,CAFe;IAMf,IAAI,gBAAgB,IAAI;MAAE,WAAW,EAAE,IAAf;MAAqB,QAAQ,EAAE,WAAW,CAAC,SAAD,EAAY,gBAAZ;IAA1C,CAAxB;EANe,CAAD,CAAhB;AAQD","sourcesContent":["import { shift as baseShift, limitShift } from '@floating-ui/dom';\nimport type { PositioningOptions } from '../types';\nimport { getBoundary } from '../utils/index';\n\nexport interface ShiftMiddlewareOptions extends Pick<PositioningOptions, 'overflowBoundary'> {\n hasScrollableElement?: boolean;\n disableTether?: PositioningOptions['unstable_disableTether'];\n container: HTMLElement | null;\n}\n\n/**\n * Wraps the floating UI shift middleware for easier usage of our options\n */\nexport function shift(options: ShiftMiddlewareOptions) {\n const { hasScrollableElement, disableTether, overflowBoundary, container } = options;\n\n return baseShift({\n ...(hasScrollableElement && { boundary: 'clippingAncestors' }),\n ...(disableTether && {\n crossAxis: disableTether === 'all',\n limiter: limitShift({ crossAxis: disableTether !== 'all', mainAxis: false }),\n }),\n ...(overflowBoundary && { altBoundary: true, boundary: getBoundary(container, overflowBoundary) }),\n });\n}\n"],"sourceRoot":""}
package/lib/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"../src/","sources":["types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\n\ntype Rect = {\n width: number;\n height: number;\n x: number;\n y: number;\n};\n\nexport type OffsetFunctionParam = {\n positionedRect: Rect;\n targetRect: Rect;\n position: Position;\n alignment?: Alignment;\n};\n\nexport type OffsetObject = { crossAxis?: number; mainAxis: number };\n\nexport type OffsetShorthand = number;\n\nexport type OffsetFunction = (param: OffsetFunctionParam) => OffsetObject | OffsetShorthand;\n\nexport type Offset = OffsetFunction | OffsetObject | OffsetShorthand;\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 = HTMLElement | Array<HTMLElement> | 'clippingParents' | 'scrollParent' | 'window';\n\nexport type PositioningImperativeRef = {\n /**\n * Updates the position 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 | PositioningVirtualElement) => void;\n};\n\nexport type PositioningVirtualElement = {\n getBoundingClientRect: () => {\n x: number;\n y: number;\n top: number;\n left: number;\n bottom: number;\n right: number;\n width: number;\n height: number;\n };\n contextElement?: Element;\n};\n\nexport interface PositioningOptions {\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 positioned element for the flip behavior. */\n flipBoundary?: Boundary | null;\n\n /** The element which will define the boundaries of the positioned element for the overflow behavior. */\n overflowBoundary?: Boundary | null;\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 position element to be positioned with 'fixed' (default value is position: 'absolute')\n * @default false\n */\n positionFixed?: boolean;\n\n /**\n * Lets you displace a positioned 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 the positioned element 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 positioned 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<PositioningOptions, 'positionFixed' | 'unstable_disableTether'> {\n /** An imperative handle to Popper methods. */\n positioningRef?: React.Ref<PositioningImperativeRef>;\n\n /**\n * Manual override for the target element. Useful for scenarios where a component accepts user prop to override target\n */\n target?: HTMLElement | PositioningVirtualElement | 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
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"","sourcesContent":["import * as React from 'react';\n\ntype Rect = {\n width: number;\n height: number;\n x: number;\n y: number;\n};\n\nexport type OffsetFunctionParam = {\n positionedRect: Rect;\n targetRect: Rect;\n position: Position;\n alignment?: Alignment;\n};\n\nexport type OffsetObject = { crossAxis?: number; mainAxis: number };\n\nexport type OffsetShorthand = number;\n\nexport type OffsetFunction = (param: OffsetFunctionParam) => OffsetObject | OffsetShorthand;\n\nexport type Offset = OffsetFunction | OffsetObject | OffsetShorthand;\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 = HTMLElement | Array<HTMLElement> | 'clippingParents' | 'scrollParent' | 'window';\n\nexport type PositioningImperativeRef = {\n /**\n * Updates the position 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 | PositioningVirtualElement) => void;\n};\n\nexport type PositioningVirtualElement = {\n getBoundingClientRect: () => {\n x: number;\n y: number;\n top: number;\n left: number;\n bottom: number;\n right: number;\n width: number;\n height: number;\n };\n contextElement?: Element;\n};\n\nexport interface PositioningOptions {\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 positioned element for the flip behavior. */\n flipBoundary?: Boundary | null;\n\n /** The element which will define the boundaries of the positioned element for the overflow behavior. */\n overflowBoundary?: Boundary | null;\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 position element to be positioned with 'fixed' (default value is position: 'absolute')\n * @default false\n */\n positionFixed?: boolean;\n\n /**\n * Lets you displace a positioned 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 the positioned element 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 positioned 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<PositioningOptions, 'positionFixed' | 'unstable_disableTether'> {\n /** An imperative handle to Popper methods. */\n positioningRef?: React.Ref<PositioningImperativeRef>;\n\n /**\n * Manual override for the target element. Useful for scenarios where a component accepts user prop to override target\n */\n target?: HTMLElement | PositioningVirtualElement | 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"]}