@fluentui/react-positioning 9.72.9-experimental.component-base-hooks.20260122-49fc330360.0 → 9.74.3-experimental.esm.20260709-49ee7a20cf.0

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 (189) hide show
  1. package/CHANGELOG.md +71 -8
  2. package/dist/index.d.cts +409 -0
  3. package/dist/index.d.ts +64 -5
  4. package/lib/PositioningConfigurationContext.js +1 -1
  5. package/lib/constants.js +6 -0
  6. package/lib/constants.js.map +1 -1
  7. package/lib/createArrowStyles.js +5 -3
  8. package/lib/createArrowStyles.js.map +1 -1
  9. package/lib/createPositionManager.js +14 -7
  10. package/lib/createPositionManager.js.map +1 -1
  11. package/lib/createSlideStyles.js +5 -2
  12. package/lib/createSlideStyles.js.map +1 -1
  13. package/lib/hooks/useSafeZoneArea/SafeZoneArea.js +9 -9
  14. package/lib/hooks/useSafeZoneArea/SafeZoneArea.js.map +1 -1
  15. package/lib/hooks/useSafeZoneArea/SafeZoneArea.styles.js +4 -2
  16. package/lib/hooks/useSafeZoneArea/SafeZoneArea.styles.js.map +1 -1
  17. package/lib/hooks/useSafeZoneArea/SafeZoneArea.styles.raw.js +3 -2
  18. package/lib/hooks/useSafeZoneArea/SafeZoneArea.styles.raw.js.map +1 -1
  19. package/lib/hooks/useSafeZoneArea/useSafeZoneArea.js +6 -4
  20. package/lib/hooks/useSafeZoneArea/useSafeZoneArea.js.map +1 -1
  21. package/lib/index.js +11 -8
  22. package/lib/index.js.map +1 -1
  23. package/lib/middleware/coverTarget.js +1 -1
  24. package/lib/middleware/coverTarget.js.map +1 -1
  25. package/lib/middleware/flip.js +2 -2
  26. package/lib/middleware/flip.js.map +1 -1
  27. package/lib/middleware/index.js +7 -7
  28. package/lib/middleware/index.js.map +1 -1
  29. package/lib/middleware/intersecting.js +1 -1
  30. package/lib/middleware/maxSize.js +3 -3
  31. package/lib/middleware/maxSize.js.map +1 -1
  32. package/lib/middleware/offset.js +2 -2
  33. package/lib/middleware/offset.js.map +1 -1
  34. package/lib/middleware/shift.js +2 -2
  35. package/lib/middleware/shift.js.map +1 -1
  36. package/lib/types.js +1 -1
  37. package/lib/types.js.map +1 -1
  38. package/lib/usePositioning.js +10 -10
  39. package/lib/usePositioning.js.map +1 -1
  40. package/lib/usePositioningMouseTarget.js +3 -3
  41. package/lib/usePositioningMouseTarget.js.map +1 -1
  42. package/lib/usePositioningOptions.js +10 -10
  43. package/lib/usePositioningOptions.js.map +1 -1
  44. package/lib/usePositioningSlideDirection.js +78 -0
  45. package/lib/usePositioningSlideDirection.js.map +1 -0
  46. package/lib/utils/devtools.js +3 -3
  47. package/lib/utils/devtools.js.map +1 -1
  48. package/lib/utils/fromFloatingUIPlacement.js +1 -1
  49. package/lib/utils/fromFloatingUIPlacement.js.map +1 -1
  50. package/lib/utils/getBoundary.js +1 -1
  51. package/lib/utils/getBoundary.js.map +1 -1
  52. package/lib/utils/getFloatingUIOffset.js +1 -1
  53. package/lib/utils/getFloatingUIOffset.js.map +1 -1
  54. package/lib/utils/getReactFiberFromNode.js +0 -1
  55. package/lib/utils/getReactFiberFromNode.js.map +1 -1
  56. package/lib/utils/hasAutoFocusFilter.js +1 -1
  57. package/lib/utils/hasAutoFocusFilter.js.map +1 -1
  58. package/lib/utils/index.js +16 -16
  59. package/lib/utils/index.js.map +1 -1
  60. package/lib/utils/listScrollParents.js +1 -1
  61. package/lib/utils/listScrollParents.js.map +1 -1
  62. package/lib/utils/toFloatingUIPadding.js.map +1 -1
  63. package/lib/utils/toggleScrollListener.js +2 -2
  64. package/lib/utils/toggleScrollListener.js.map +1 -1
  65. package/lib/utils/useCallbackRef.js +2 -2
  66. package/lib/utils/writeArrowUpdates.js.map +1 -1
  67. package/lib/utils/writeContainerupdates.js +1 -1
  68. package/lib/utils/writeContainerupdates.js.map +1 -1
  69. package/lib-commonjs/{constants.js → constants.cjs} +8 -0
  70. package/lib-commonjs/constants.cjs.map +1 -0
  71. package/lib-commonjs/createArrowStyles.cjs.map +1 -0
  72. package/lib-commonjs/{createPositionManager.js → createPositionManager.cjs} +15 -8
  73. package/lib-commonjs/createPositionManager.cjs.map +1 -0
  74. package/lib-commonjs/{createSlideStyles.js → createSlideStyles.cjs} +1 -1
  75. package/lib-commonjs/createSlideStyles.cjs.map +1 -0
  76. package/lib-commonjs/hooks/useSafeZoneArea/{SafeZoneArea.js → SafeZoneArea.cjs} +5 -5
  77. package/lib-commonjs/hooks/useSafeZoneArea/{SafeZoneArea.js.map → SafeZoneArea.cjs.map} +1 -1
  78. package/lib-commonjs/hooks/useSafeZoneArea/{SafeZoneArea.styles.js → SafeZoneArea.styles.cjs} +1 -0
  79. package/lib-commonjs/hooks/useSafeZoneArea/SafeZoneArea.styles.cjs.map +1 -0
  80. package/lib-commonjs/hooks/useSafeZoneArea/{SafeZoneArea.styles.raw.js → SafeZoneArea.styles.raw.cjs} +1 -0
  81. package/lib-commonjs/hooks/useSafeZoneArea/SafeZoneArea.styles.raw.cjs.map +1 -0
  82. package/lib-commonjs/hooks/useSafeZoneArea/{useSafeZoneArea.js → useSafeZoneArea.cjs} +4 -2
  83. package/lib-commonjs/hooks/useSafeZoneArea/useSafeZoneArea.cjs.map +1 -0
  84. package/lib-commonjs/{index.js → index.cjs} +19 -8
  85. package/lib-commonjs/index.cjs.map +1 -0
  86. package/lib-commonjs/middleware/{coverTarget.js → coverTarget.cjs} +1 -1
  87. package/lib-commonjs/middleware/{coverTarget.js.map → coverTarget.cjs.map} +1 -1
  88. package/lib-commonjs/middleware/{flip.js → flip.cjs} +1 -1
  89. package/lib-commonjs/middleware/flip.cjs.map +1 -0
  90. package/lib-commonjs/middleware/{index.js → index.cjs} +7 -7
  91. package/lib-commonjs/middleware/{index.js.map → index.cjs.map} +1 -1
  92. package/lib-commonjs/middleware/{maxSize.js → maxSize.cjs} +3 -3
  93. package/lib-commonjs/middleware/{maxSize.js.map → maxSize.cjs.map} +1 -1
  94. package/lib-commonjs/middleware/{offset.js → offset.cjs} +1 -1
  95. package/lib-commonjs/middleware/offset.cjs.map +1 -0
  96. package/lib-commonjs/middleware/{shift.js → shift.cjs} +1 -1
  97. package/lib-commonjs/middleware/shift.cjs.map +1 -0
  98. package/lib-commonjs/types.cjs +4 -0
  99. package/lib-commonjs/types.cjs.map +1 -0
  100. package/lib-commonjs/{usePositioning.js → usePositioning.cjs} +10 -11
  101. package/lib-commonjs/usePositioning.cjs.map +1 -0
  102. package/lib-commonjs/{usePositioningMouseTarget.js → usePositioningMouseTarget.cjs} +1 -1
  103. package/lib-commonjs/usePositioningMouseTarget.cjs.map +1 -0
  104. package/lib-commonjs/{usePositioningOptions.js → usePositioningOptions.cjs} +17 -17
  105. package/lib-commonjs/{usePositioningOptions.js.map → usePositioningOptions.cjs.map} +1 -1
  106. package/lib-commonjs/usePositioningSlideDirection.cjs +86 -0
  107. package/lib-commonjs/usePositioningSlideDirection.cjs.map +1 -0
  108. package/lib-commonjs/utils/{devtools.js → devtools.cjs} +2 -2
  109. package/lib-commonjs/utils/{devtools.js.map → devtools.cjs.map} +1 -1
  110. package/lib-commonjs/utils/{fromFloatingUIPlacement.js → fromFloatingUIPlacement.cjs} +1 -1
  111. package/lib-commonjs/utils/{fromFloatingUIPlacement.js.map → fromFloatingUIPlacement.cjs.map} +1 -1
  112. package/lib-commonjs/utils/{getBoundary.js → getBoundary.cjs} +1 -1
  113. package/lib-commonjs/utils/{getBoundary.js.map → getBoundary.cjs.map} +1 -1
  114. package/lib-commonjs/utils/{getFloatingUIOffset.js → getFloatingUIOffset.cjs} +1 -1
  115. package/lib-commonjs/utils/{getFloatingUIOffset.js.map → getFloatingUIOffset.cjs.map} +1 -1
  116. package/lib-commonjs/utils/{getReactFiberFromNode.js → getReactFiberFromNode.cjs} +0 -2
  117. package/lib-commonjs/utils/getReactFiberFromNode.cjs.map +1 -0
  118. package/lib-commonjs/utils/{hasAutoFocusFilter.js → hasAutoFocusFilter.cjs} +1 -1
  119. package/lib-commonjs/utils/{hasAutoFocusFilter.js.map → hasAutoFocusFilter.cjs.map} +1 -1
  120. package/lib-commonjs/utils/{index.js → index.cjs} +16 -16
  121. package/lib-commonjs/utils/{index.js.map → index.cjs.map} +1 -1
  122. package/lib-commonjs/utils/{listScrollParents.js → listScrollParents.cjs} +1 -1
  123. package/lib-commonjs/utils/{listScrollParents.js.map → listScrollParents.cjs.map} +1 -1
  124. package/lib-commonjs/utils/toFloatingUIPadding.cjs.map +1 -0
  125. package/lib-commonjs/utils/{toggleScrollListener.js → toggleScrollListener.cjs} +1 -1
  126. package/lib-commonjs/utils/{toggleScrollListener.js.map → toggleScrollListener.cjs.map} +1 -1
  127. package/lib-commonjs/utils/writeArrowUpdates.cjs.map +1 -0
  128. package/lib-commonjs/utils/{writeContainerupdates.js → writeContainerupdates.cjs} +1 -1
  129. package/lib-commonjs/utils/{writeContainerupdates.js.map → writeContainerupdates.cjs.map} +1 -1
  130. package/package.json +16 -10
  131. package/lib-commonjs/constants.js.map +0 -1
  132. package/lib-commonjs/createArrowStyles.js.map +0 -1
  133. package/lib-commonjs/createPositionManager.js.map +0 -1
  134. package/lib-commonjs/createSlideStyles.js.map +0 -1
  135. package/lib-commonjs/hooks/useSafeZoneArea/SafeZoneArea.styles.js.map +0 -1
  136. package/lib-commonjs/hooks/useSafeZoneArea/SafeZoneArea.styles.raw.js.map +0 -1
  137. package/lib-commonjs/hooks/useSafeZoneArea/useSafeZoneArea.js.map +0 -1
  138. package/lib-commonjs/index.js.map +0 -1
  139. package/lib-commonjs/middleware/flip.js.map +0 -1
  140. package/lib-commonjs/middleware/offset.js.map +0 -1
  141. package/lib-commonjs/middleware/shift.js.map +0 -1
  142. package/lib-commonjs/types.js +0 -6
  143. package/lib-commonjs/types.js.map +0 -1
  144. package/lib-commonjs/usePositioning.js.map +0 -1
  145. package/lib-commonjs/usePositioningMouseTarget.js.map +0 -1
  146. package/lib-commonjs/utils/getReactFiberFromNode.js.map +0 -1
  147. package/lib-commonjs/utils/toFloatingUIPadding.js.map +0 -1
  148. package/lib-commonjs/utils/writeArrowUpdates.js.map +0 -1
  149. /package/lib-commonjs/{PositioningConfigurationContext.js → PositioningConfigurationContext.cjs} +0 -0
  150. /package/lib-commonjs/{PositioningConfigurationContext.js.map → PositioningConfigurationContext.cjs.map} +0 -0
  151. /package/lib-commonjs/{createArrowStyles.js → createArrowStyles.cjs} +0 -0
  152. /package/lib-commonjs/{createVirtualElementFromClick.js → createVirtualElementFromClick.cjs} +0 -0
  153. /package/lib-commonjs/{createVirtualElementFromClick.js.map → createVirtualElementFromClick.cjs.map} +0 -0
  154. /package/lib-commonjs/hooks/useSafeZoneArea/{computeOutsideClipPath.js → computeOutsideClipPath.cjs} +0 -0
  155. /package/lib-commonjs/hooks/useSafeZoneArea/{computeOutsideClipPath.js.map → computeOutsideClipPath.cjs.map} +0 -0
  156. /package/lib-commonjs/hooks/useSafeZoneArea/{createSafeZoneAreaStateStore.js → createSafeZoneAreaStateStore.cjs} +0 -0
  157. /package/lib-commonjs/hooks/useSafeZoneArea/{createSafeZoneAreaStateStore.js.map → createSafeZoneAreaStateStore.cjs.map} +0 -0
  158. /package/lib-commonjs/hooks/useSafeZoneArea/{getMouseAnchor.js → getMouseAnchor.cjs} +0 -0
  159. /package/lib-commonjs/hooks/useSafeZoneArea/{getMouseAnchor.js.map → getMouseAnchor.cjs.map} +0 -0
  160. /package/lib-commonjs/hooks/useSafeZoneArea/{getRectCorners.js → getRectCorners.cjs} +0 -0
  161. /package/lib-commonjs/hooks/useSafeZoneArea/{getRectCorners.js.map → getRectCorners.cjs.map} +0 -0
  162. /package/lib-commonjs/hooks/useSafeZoneArea/{pointsToSvgPath.js → pointsToSvgPath.cjs} +0 -0
  163. /package/lib-commonjs/hooks/useSafeZoneArea/{pointsToSvgPath.js.map → pointsToSvgPath.cjs.map} +0 -0
  164. /package/lib-commonjs/hooks/useSafeZoneArea/{types.js → types.cjs} +0 -0
  165. /package/lib-commonjs/hooks/useSafeZoneArea/{types.js.map → types.cjs.map} +0 -0
  166. /package/lib-commonjs/middleware/{intersecting.js → intersecting.cjs} +0 -0
  167. /package/lib-commonjs/middleware/{intersecting.js.map → intersecting.cjs.map} +0 -0
  168. /package/lib-commonjs/middleware/{matchTargetSize.js → matchTargetSize.cjs} +0 -0
  169. /package/lib-commonjs/middleware/{matchTargetSize.js.map → matchTargetSize.cjs.map} +0 -0
  170. /package/lib-commonjs/utils/{createResizeObserver.js → createResizeObserver.cjs} +0 -0
  171. /package/lib-commonjs/utils/{createResizeObserver.js.map → createResizeObserver.cjs.map} +0 -0
  172. /package/lib-commonjs/utils/{debounce.js → debounce.cjs} +0 -0
  173. /package/lib-commonjs/utils/{debounce.js.map → debounce.cjs.map} +0 -0
  174. /package/lib-commonjs/utils/{getScrollParent.js → getScrollParent.cjs} +0 -0
  175. /package/lib-commonjs/utils/{getScrollParent.js.map → getScrollParent.cjs.map} +0 -0
  176. /package/lib-commonjs/utils/{mergeArrowOffset.js → mergeArrowOffset.cjs} +0 -0
  177. /package/lib-commonjs/utils/{mergeArrowOffset.js.map → mergeArrowOffset.cjs.map} +0 -0
  178. /package/lib-commonjs/utils/{normalizeAutoSize.js → normalizeAutoSize.cjs} +0 -0
  179. /package/lib-commonjs/utils/{normalizeAutoSize.js.map → normalizeAutoSize.cjs.map} +0 -0
  180. /package/lib-commonjs/utils/{parseFloatingUIPlacement.js → parseFloatingUIPlacement.cjs} +0 -0
  181. /package/lib-commonjs/utils/{parseFloatingUIPlacement.js.map → parseFloatingUIPlacement.cjs.map} +0 -0
  182. /package/lib-commonjs/utils/{resolvePositioningShorthand.js → resolvePositioningShorthand.cjs} +0 -0
  183. /package/lib-commonjs/utils/{resolvePositioningShorthand.js.map → resolvePositioningShorthand.cjs.map} +0 -0
  184. /package/lib-commonjs/utils/{toFloatingUIPadding.js → toFloatingUIPadding.cjs} +0 -0
  185. /package/lib-commonjs/utils/{toFloatingUIPlacement.js → toFloatingUIPlacement.cjs} +0 -0
  186. /package/lib-commonjs/utils/{toFloatingUIPlacement.js.map → toFloatingUIPlacement.cjs.map} +0 -0
  187. /package/lib-commonjs/utils/{useCallbackRef.js → useCallbackRef.cjs} +0 -0
  188. /package/lib-commonjs/utils/{useCallbackRef.js.map → useCallbackRef.cjs.map} +0 -0
  189. /package/lib-commonjs/utils/{writeArrowUpdates.js → writeArrowUpdates.cjs} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,20 +1,83 @@
1
1
  # Change Log - @fluentui/react-positioning
2
2
 
3
- This log was last generated on Thu, 22 Jan 2026 16:12:43 GMT and should not be manually modified.
3
+ This log was last generated on Thu, 09 Jul 2026 17:34:14 GMT and should not be manually modified.
4
4
 
5
5
  <!-- Start content -->
6
6
 
7
- ## [9.72.9-experimental.component-base-hooks.20260122-49fc330360.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.72.9-experimental.component-base-hooks.20260122-49fc330360.0)
7
+ ## [9.74.3-experimental.esm.20260709-49ee7a20cf.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.74.3-experimental.esm.20260709-49ee7a20cf.0)
8
8
 
9
- Thu, 22 Jan 2026 16:12:43 GMT
10
- [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.20.11..@fluentui/react-positioning_v9.72.9-experimental.component-base-hooks.20260122-49fc330360.0)
9
+ Thu, 09 Jul 2026 17:34:14 GMT
10
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.22.3..@fluentui/react-positioning_v9.74.3-experimental.esm.20260709-49ee7a20cf.0)
11
11
 
12
12
  ### Changes
13
13
 
14
- - Release 9.72.9-experimental.component-base-hooks.20260122-49fc330360 ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
15
- - Bump @fluentui/react-shared-contexts to v9.72.9-experimental.component-base-hooks.20260122-49fc330360.0 ([commit](https://github.com/microsoft/fluentui/commit/373001c3e19d022ef1fcf745ea96375cf4f3aff1) by beachball)
16
- - Bump @fluentui/react-theme to v9.72.9-experimental.component-base-hooks.20260122-49fc330360.0 ([commit](https://github.com/microsoft/fluentui/commit/373001c3e19d022ef1fcf745ea96375cf4f3aff1) by beachball)
17
- - Bump @fluentui/react-utilities to v9.72.9-experimental.component-base-hooks.20260122-49fc330360.0 ([commit](https://github.com/microsoft/fluentui/commit/373001c3e19d022ef1fcf745ea96375cf4f3aff1) by beachball)
14
+ - Release 9.74.3-experimental.esm.20260709-49ee7a20cf ([commit](https://github.com/microsoft/fluentui/commit/not available) by fluentui-internal@service.microsoft.com)
15
+ - Bump @fluentui/react-shared-contexts to v9.74.3-experimental.esm.20260709-49ee7a20cf.0 ([commit](https://github.com/microsoft/fluentui/commit/175a26e0c520dd90a54578d1185a3b0b6c446e15) by beachball)
16
+ - Bump @fluentui/react-theme to v9.74.3-experimental.esm.20260709-49ee7a20cf.0 ([commit](https://github.com/microsoft/fluentui/commit/175a26e0c520dd90a54578d1185a3b0b6c446e15) by beachball)
17
+ - Bump @fluentui/react-utilities to v9.74.3-experimental.esm.20260709-49ee7a20cf.0 ([commit](https://github.com/microsoft/fluentui/commit/175a26e0c520dd90a54578d1185a3b0b6c446e15) by beachball)
18
+
19
+ ## [9.22.3](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.22.3)
20
+
21
+ Wed, 24 Jun 2026 11:09:53 GMT
22
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.22.2..@fluentui/react-positioning_v9.22.3)
23
+
24
+ ### Patches
25
+
26
+ - fix: remove redundant use no memo directives, and add justification to valid ones ([PR #36224](https://github.com/microsoft/fluentui/pull/36224) by martinhochel@microsoft.com)
27
+ - Bump @fluentui/react-utilities to v9.26.5 ([commit](https://github.com/microsoft/fluentui/commit/a4b871ca80c1f16f35ab4229def4fe02be7f30ea) by beachball)
28
+
29
+ ## [9.22.2](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.22.2)
30
+
31
+ Tue, 26 May 2026 09:39:32 GMT
32
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.22.1..@fluentui/react-positioning_v9.22.2)
33
+
34
+ ### Patches
35
+
36
+ - Bump @fluentui/react-utilities to v9.26.4 ([PR #36246](https://github.com/microsoft/fluentui/pull/36246) by beachball)
37
+
38
+ ## [9.22.1](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.22.1)
39
+
40
+ Thu, 23 Apr 2026 14:21:10 GMT
41
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.22.0..@fluentui/react-positioning_v9.22.1)
42
+
43
+ ### Patches
44
+
45
+ - Bump @fluentui/react-utilities to v9.26.3 ([PR #36035](https://github.com/microsoft/fluentui/pull/36035) by beachball)
46
+
47
+ ## [9.22.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.22.0)
48
+
49
+ Tue, 03 Mar 2026 09:43:41 GMT
50
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.21.0..@fluentui/react-positioning_v9.22.0)
51
+
52
+ ### Minor changes
53
+
54
+ - refactor: deprecate createSlideStyles ([PR #35763](https://github.com/microsoft/fluentui/pull/35763) by robertpenner@microsoft.com)
55
+
56
+ ## [9.21.0](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.21.0)
57
+
58
+ Wed, 25 Feb 2026 13:32:24 GMT
59
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.20.12..@fluentui/react-positioning_v9.21.0)
60
+
61
+ ### Minor changes
62
+
63
+ - feat(react-positioning): add placement to onPositioningEnd event ([PR #35773](https://github.com/microsoft/fluentui/pull/35773) by robertpenner@microsoft.com)
64
+ - Bump @fluentui/react-shared-contexts to v9.26.2 ([PR #35782](https://github.com/microsoft/fluentui/pull/35782) by beachball)
65
+ - Bump @fluentui/react-utilities to v9.26.2 ([PR #35782](https://github.com/microsoft/fluentui/pull/35782) by beachball)
66
+
67
+ ### Patches
68
+
69
+ - fix: add missing "use client" directive to client components and styles ([PR #35719](https://github.com/microsoft/fluentui/pull/35719) by dmytrokirpa@microsoft.com)
70
+
71
+ ## [9.20.12](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.20.12)
72
+
73
+ Thu, 22 Jan 2026 17:06:36 GMT
74
+ [Compare changes](https://github.com/microsoft/fluentui/compare/@fluentui/react-positioning_v9.20.11..@fluentui/react-positioning_v9.20.12)
75
+
76
+ ### Patches
77
+
78
+ - Bump @fluentui/react-shared-contexts to v9.26.1 ([PR #35574](https://github.com/microsoft/fluentui/pull/35574) by beachball)
79
+ - Bump @fluentui/react-theme to v9.2.1 ([PR #35574](https://github.com/microsoft/fluentui/pull/35574) by beachball)
80
+ - Bump @fluentui/react-utilities to v9.26.1 ([PR #35574](https://github.com/microsoft/fluentui/pull/35574) by beachball)
18
81
 
19
82
  ## [9.20.11](https://github.com/microsoft/fluentui/tree/@fluentui/react-positioning_v9.20.11)
20
83
 
@@ -0,0 +1,409 @@
1
+ import type { GriffelStyle } from '@griffel/react';
2
+ import type { JSXElement } from '@fluentui/react-utilities';
3
+ import * as React_2 from 'react';
4
+ import type { RefObjectFunction } from '@fluentui/react-utilities';
5
+
6
+ export declare type Alignment = 'top' | 'bottom' | 'start' | 'end' | 'center';
7
+
8
+ export declare type AutoSize = 'height' | 'height-always' | 'width' | 'width-always' | 'always' | boolean;
9
+
10
+ /**
11
+ * @deprecated use PositioningBoundary instead
12
+ */
13
+ export declare type Boundary = PositioningBoundary;
14
+
15
+ /**
16
+ * Creates CSS styles to size the arrow created by createArrowStyles to the given height.
17
+ *
18
+ * Use this when you need to create classes for several different arrow sizes. If you only need a
19
+ * constant arrow size, you can pass the `arrowHeight` param to createArrowStyles instead.
20
+ *
21
+ * @internal
22
+ */
23
+ export declare function createArrowHeightStyles(arrowHeight: number): GriffelStyle;
24
+
25
+ /**
26
+ * Helper that creates a makeStyles rule for an arrow element.
27
+ * For runtime arrow size toggling simply create extra classnames to apply to the arrow element
28
+ *
29
+ * ```ts
30
+ * makeStyles({
31
+ * arrowWithSize: createArrowStyles({ arrowHeight: 6 }),
32
+ *
33
+ * arrowWithoutSize: createArrowStyles({ arrowHeight: undefined }),
34
+ * mediumArrow: createArrowHeightStyles(4),
35
+ * smallArrow: createArrowHeightStyles(2),
36
+ * })
37
+ * ...
38
+ *
39
+ * state.arrowWithSize.className = styles.arrowWithSize;
40
+ * state.arrowWithoutSize.className = mergeClasses(
41
+ * styles.arrowWithoutSize,
42
+ * state.smallArrow && styles.smallArrow,
43
+ * state.mediumArrow && styles.mediumArrow,
44
+ * )
45
+ * ```
46
+ *
47
+ * @internal
48
+ */
49
+ export declare function createArrowStyles(options: CreateArrowStylesOptions): GriffelStyle;
50
+
51
+ /**
52
+ * Options parameter for the createArrowStyles function
53
+ *
54
+ * @internal
55
+ */
56
+ export declare type CreateArrowStylesOptions = {
57
+ /**
58
+ * The height of the arrow from the base to the tip, in px. The base width of the arrow is always twice its height.
59
+ *
60
+ * This can be undefined to leave out the arrow size styles. You must then add styles created by
61
+ * createArrowHeightStyles to set the arrow's size correctly. This can be useful if the arrow can be different sizes.
62
+ */
63
+ arrowHeight: number | undefined;
64
+ /**
65
+ * The borderWidth of the arrow. Should be the same borderWidth as the parent element.
66
+ *
67
+ * @defaultvalue 1px
68
+ */
69
+ borderWidth?: GriffelStyle['borderBottomWidth'];
70
+ /**
71
+ * The borderStyle for the arrow. Should be the same borderStyle as the parent element.
72
+ *
73
+ * @defaultvalue solid
74
+ */
75
+ borderStyle?: GriffelStyle['borderBottomStyle'];
76
+ /**
77
+ * The borderColor of the arrow. Should be the same borderColor as the parent element.
78
+ *
79
+ * @defaultvalue tokens.colorTransparentStroke
80
+ */
81
+ borderColor?: GriffelStyle['borderBottomColor'];
82
+ };
83
+
84
+ /**
85
+ * Creates animation styles so that positioned elements slide in from the main axis
86
+ * @param mainAxis - distance than the element sides for
87
+ * @returns Griffel styles to spread to a slot
88
+ *
89
+ * @deprecated The popover-related components now use the Slide motion component,
90
+ * which they inject using the `surfaceMotion` slot.
91
+ */
92
+ export declare function createSlideStyles(mainAxis: number): GriffelStyle;
93
+
94
+ /**
95
+ * Creates a virtual element based on the position of a click event
96
+ * Can be used as a target for popper in scenarios such as context menus
97
+ */
98
+ export declare function createVirtualElementFromClick(nativeEvent: MouseEvent): PositioningVirtualElement;
99
+
100
+ /**
101
+ * Generally when adding an arrow to popper, it's necessary to offset the position of the popper by the
102
+ * height of the arrow. A simple utility to merge a provided offset with an arrow height to return the final offset
103
+ *
104
+ * @internal
105
+ * @param userOffset - The offset provided by the user
106
+ * @param arrowHeight - The height of the arrow in px
107
+ * @returns User offset augmented with arrow height
108
+ */
109
+ export declare function mergeArrowOffset(userOffset: Offset | undefined | null, arrowHeight: number): Offset;
110
+
111
+ export declare type Offset = OffsetFunction | OffsetObject | OffsetShorthand;
112
+
113
+ export declare type OffsetFunction = (param: OffsetFunctionParam) => OffsetObject | OffsetShorthand;
114
+
115
+ export declare type OffsetFunctionParam = {
116
+ positionedRect: PositioningRect;
117
+ targetRect: PositioningRect;
118
+ position: Position;
119
+ alignment?: Alignment;
120
+ };
121
+
122
+ export declare type OffsetObject = {
123
+ crossAxis?: number;
124
+ mainAxis: number;
125
+ };
126
+
127
+ export declare type OffsetShorthand = number;
128
+
129
+ /**
130
+ * Custom DOM event dispatched on the positioned container element when a
131
+ * positioning update completes. Carries placement information in `event.detail`.
132
+ */
133
+ declare type OnPositioningEndEvent = CustomEvent<OnPositioningEndEventDetail>;
134
+
135
+ /**
136
+ * Detail payload of the positioning end event, providing the final computed placement
137
+ * after all middleware (flip, shift, etc.) have run.
138
+ */
139
+ declare type OnPositioningEndEventDetail = {
140
+ /**
141
+ * The computed placement of the positioned element. May differ from the requested
142
+ * placement if flip or other middleware adjusted it.
143
+ */
144
+ placement: PositioningPlacement;
145
+ };
146
+
147
+ export declare type Position = 'above' | 'below' | 'before' | 'after';
148
+
149
+ /**
150
+ * CSS custom properties used to encode the slide direction for positioning-aware enter animations.
151
+ * Set at runtime by `usePositioningSlideDirection` and registered via the CSS
152
+ * `registerProperty()` API so browsers can interpolate them as `<length>` values.
153
+ */
154
+ export declare const POSITIONING_SLIDE_DIRECTION_VAR_X = "--fui-positioning-slide-direction-x";
155
+
156
+ export declare const POSITIONING_SLIDE_DIRECTION_VAR_Y = "--fui-positioning-slide-direction-y";
157
+
158
+ export declare type PositioningBoundary = PositioningRect | HTMLElement | Array<HTMLElement> | 'clippingParents' | 'scrollParent' | 'window';
159
+
160
+ export declare type PositioningConfigurationFn = (params: {
161
+ container: HTMLElement;
162
+ arrow: HTMLElement | null;
163
+ options: PositioningConfigurationFnOptions;
164
+ }) => PositioningConfigurationFnOptions;
165
+
166
+ export declare type PositioningConfigurationFnOptions = Omit<PositioningOptions, 'enabled' | 'onPositioningEnd' | 'positionFixed'>;
167
+
168
+ /**
169
+ * A context provider for the positioning configuration.
170
+ *
171
+ * Accepts a function that takes the positioning options and returns them modified.
172
+ */
173
+ export declare const PositioningConfigurationProvider: React_2.Provider<PositioningConfigurationFn | undefined>;
174
+
175
+ export declare type PositioningImperativeRef = {
176
+ /**
177
+ * Updates the position imperatively.
178
+ * Useful when the position of the target changes from other factors than scrolling of window resize.
179
+ */
180
+ updatePosition: () => void;
181
+ /**
182
+ * Sets the target and updates positioning imperatively.
183
+ * Useful for avoiding double renders with the target option.
184
+ */
185
+ setTarget: (target: TargetElement | null) => void;
186
+ };
187
+
188
+ /**
189
+ * Internal options for positioning
190
+ */
191
+ declare interface PositioningOptions {
192
+ /** Alignment for the component. Only has an effect if used with the @see position option */
193
+ align?: Alignment;
194
+ /** The element which will define the boundaries of the positioned element for the flip behavior. */
195
+ flipBoundary?: PositioningBoundary | null;
196
+ /** The element which will define the boundaries of the positioned element for the overflow behavior. */
197
+ overflowBoundary?: PositioningBoundary | null;
198
+ /**
199
+ * Applies a padding to the overflow bounadry, so that overflow is detected earlier before the
200
+ * positioned surface hits the overflow boundary.
201
+ */
202
+ overflowBoundaryPadding?: number | Partial<{
203
+ top: number;
204
+ end: number;
205
+ bottom: number;
206
+ start: number;
207
+ }>;
208
+ /**
209
+ * Position for the component. Position has higher priority than align. If position is vertical ('above' | 'below')
210
+ * and align is also vertical ('top' | 'bottom') or if both position and align are horizontal ('before' | 'after'
211
+ * and 'start' | 'end' respectively),
212
+ * then provided value for 'align' will be ignored and 'center' will be used instead.
213
+ */
214
+ position?: Position;
215
+ /**
216
+ * Enables the position element to be positioned with 'fixed' (default value is position: 'absolute')
217
+ * @default false
218
+ * @deprecated use `strategy` instead
219
+ */
220
+ positionFixed?: boolean;
221
+ /**
222
+ * Specifies the type of CSS position property to use.
223
+ * @default absolute
224
+ */
225
+ strategy?: 'absolute' | 'fixed';
226
+ /**
227
+ * Lets you displace a positioned element from its reference element.
228
+ * This can be useful if you need to apply some margin between them or if you need to fine tune the
229
+ * position according to some custom logic.
230
+ */
231
+ offset?: Offset;
232
+ /**
233
+ * Defines padding between the corner of the popup element and the arrow.
234
+ * Use to prevent the arrow from overlapping a rounded corner, for example.
235
+ */
236
+ arrowPadding?: number;
237
+ /**
238
+ * Applies styles on the positioned element to fit it within the available space in viewport.
239
+ * - true: set styles for max height/width.
240
+ * - 'height': set styles for max height.
241
+ * - 'width'': set styles for max width.
242
+ * Note that options 'always'/'height-always'/'width-always' are now obsolete, and equivalent to true/'height'/'width'.
243
+ */
244
+ autoSize?: AutoSize;
245
+ /**
246
+ * Modifies position and alignment to cover the target
247
+ */
248
+ coverTarget?: boolean;
249
+ /**
250
+ * Disables automatic repositioning of the component; it will always be placed according to the values of `align` and
251
+ * `position` props, regardless of the size of the component, the reference element or the viewport.
252
+ */
253
+ pinned?: boolean;
254
+ /**
255
+ * When the reference element or the viewport is outside viewport allows a positioned element to be fully in viewport.
256
+ * "all" enables this behavior for all axis.
257
+ */
258
+ unstable_disableTether?: boolean | 'all';
259
+ /**
260
+ * If flip fails to stop the positioned element from overflowing
261
+ * its boundaries, use a specified fallback positions.
262
+ */
263
+ fallbackPositions?: PositioningShorthandValue[];
264
+ /**
265
+ * Modifies whether popover is positioned using transform.
266
+ * @default true
267
+ */
268
+ useTransform?: boolean;
269
+ /**
270
+ * If false, does not position anything
271
+ */
272
+ enabled?: boolean;
273
+ /**
274
+ * When set, the positioned element matches the chosen dimension(s) of the target element
275
+ */
276
+ matchTargetSize?: 'width';
277
+ /**
278
+ * Called when a position update has finished. Multiple position updates can happen in a single render,
279
+ * since positioning happens outside of the React lifecycle.
280
+ * The event's `detail.placement` indicates the final computed placement after middleware adjustments.
281
+ *
282
+ * It's also possible to listen to the custom DOM event `fui-positioningend`
283
+ */
284
+ onPositioningEnd?: (e: OnPositioningEndEvent) => void;
285
+ /**
286
+ * Disables the resize observer that updates position on target or dimension change
287
+ */
288
+ disableUpdateOnResize?: boolean;
289
+ /**
290
+ * When true, the positioned element will shift to cover the target element when there's not enough space.
291
+ * @default false
292
+ */
293
+ shiftToCoverTarget?: boolean;
294
+ }
295
+
296
+ /**
297
+ * Physical placement of a positioned element relative to its target, as computed by Floating UI.
298
+ * This is a Fluent-owned equivalent of Floating UI's `Placement` type, avoiding a transitive
299
+ * dependency on `@floating-ui/dom` in the public API surface.
300
+ */
301
+ declare type PositioningPlacement = 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end';
302
+
303
+ /**
304
+ * Public api that allows components using react-positioning to specify positioning options
305
+ */
306
+ export declare interface PositioningProps extends Pick<PositioningOptions, 'align' | 'arrowPadding' | 'autoSize' | 'coverTarget' | 'fallbackPositions' | 'flipBoundary' | 'offset' | 'overflowBoundary' | 'overflowBoundaryPadding' | 'pinned' | 'position' | 'strategy' | 'useTransform' | 'matchTargetSize' | 'onPositioningEnd' | 'disableUpdateOnResize' | 'shiftToCoverTarget'> {
307
+ /** An imperative handle to Popper methods. */
308
+ positioningRef?: React_2.Ref<PositioningImperativeRef>;
309
+ /**
310
+ * Manual override for the target element. Useful for scenarios where a component accepts user prop to override target
311
+ */
312
+ target?: TargetElement | null;
313
+ }
314
+
315
+ export declare type PositioningRect = {
316
+ width: number;
317
+ height: number;
318
+ x: number;
319
+ y: number;
320
+ };
321
+
322
+ export declare type PositioningShorthand = PositioningProps | PositioningShorthandValue;
323
+
324
+ export declare type PositioningShorthandValue = 'above' | 'above-start' | 'above-end' | 'below' | 'below-start' | 'below-end' | 'before' | 'before-top' | 'before-bottom' | 'after' | 'after-top' | 'after-bottom';
325
+
326
+ export declare type PositioningVirtualElement = {
327
+ getBoundingClientRect: () => {
328
+ x: number;
329
+ y: number;
330
+ top: number;
331
+ left: number;
332
+ bottom: number;
333
+ right: number;
334
+ width: number;
335
+ height: number;
336
+ };
337
+ contextElement?: Element;
338
+ };
339
+
340
+ export declare function resolvePositioningShorthand(shorthand: PositioningShorthand | undefined | null): Readonly<PositioningProps>;
341
+
342
+ export declare type SetVirtualMouseTarget = (event: React_2.MouseEvent | MouseEvent | undefined | null) => void;
343
+
344
+ declare type TargetElement = HTMLElement | PositioningVirtualElement;
345
+
346
+ /**
347
+ * @internal
348
+ */
349
+ export declare function usePositioning(options: PositioningProps & PositioningOptions): UsePositioningReturn;
350
+
351
+ /**
352
+ * A state hook that manages a popper virtual element from mouseevents.
353
+ * Useful for scenarios where a component needs to be positioned by mouse click (e.g. contextmenu)
354
+ * React synthetic events are not persisted by this hook
355
+ *
356
+ * @internal
357
+ * @param initialState - initializes a user provided state similare to useState
358
+ * @returns state and dispatcher for a Popper virtual element that uses native/synthetic mouse events
359
+ */
360
+ export declare const usePositioningMouseTarget: (initialState?: PositioningVirtualElement | (() => PositioningVirtualElement)) => readonly [PositioningVirtualElement | undefined, SetVirtualMouseTarget];
361
+
362
+ declare interface UsePositioningReturn {
363
+ targetRef: React_2.MutableRefObject<any>;
364
+ containerRef: React_2.MutableRefObject<any>;
365
+ arrowRef: React_2.MutableRefObject<any>;
366
+ }
367
+
368
+ /**
369
+ * A hook that manages CSS custom properties for slide direction based on positioning placement.
370
+ *
371
+ * It wraps the `onPositioningEnd` callback to set `--fui-positioning-slide-direction-x` and
372
+ * `--fui-positioning-slide-direction-y` CSS custom properties on the positioned element,
373
+ * and registers them via `CSS.registerProperty` to avoid properties propagation down to a DOM tree.
374
+ *
375
+ * @returns The wrapped `onPositioningEnd` handler to pass to the positioning config.
376
+ */
377
+ export declare function usePositioningSlideDirection(options: UsePositioningSlideDirectionOptions): NonNullable<PositioningProps['onPositioningEnd']>;
378
+
379
+ declare type UsePositioningSlideDirectionOptions = {
380
+ /** The target document for CSS.registerProperty. */
381
+ targetDocument: Document | undefined;
382
+ /** The user's original onPositioningEnd callback, if any. */
383
+ onPositioningEnd?: PositioningProps['onPositioningEnd'];
384
+ };
385
+
386
+ export declare function useSafeZoneArea({ debug, disabled, onSafeZoneEnter, onSafeZoneMove, onSafeZoneLeave, onSafeZoneTimeout, timeout, }?: UseSafeZoneOptions): {
387
+ containerRef: RefObjectFunction<HTMLElement>;
388
+ targetRef: RefObjectFunction<HTMLElement>;
389
+ elementToRender: JSXElement | null;
390
+ };
391
+
392
+ export declare type UseSafeZoneOptions = {
393
+ /** Enables debug mode: makes drawn shapes visible. */
394
+ debug?: boolean;
395
+ /** Disables the safe zone area. */
396
+ disabled?: boolean;
397
+ /** The time in milliseconds to wait before clearing the safe zone. */
398
+ timeout?: number;
399
+ /** Called when the mouse enters the safe zone. */
400
+ onSafeZoneEnter?: (e: React_2.MouseEvent) => void;
401
+ /** Called when the mouse moves within the safe zone. */
402
+ onSafeZoneMove?: (e: React_2.MouseEvent) => void;
403
+ /** Called when the mouse leaves the safe zone. */
404
+ onSafeZoneLeave?: (e: React_2.MouseEvent) => void;
405
+ /** Called when the safe zone times out, even if a cursor is still over a safe zone. */
406
+ onSafeZoneTimeout?: () => void;
407
+ };
408
+
409
+ export { }
package/dist/index.d.ts CHANGED
@@ -13,16 +13,16 @@ export declare type AutoSize = 'height' | 'height-always' | 'width' | 'width-alw
13
13
  export declare type Boundary = PositioningBoundary;
14
14
 
15
15
  /**
16
- * @internal
17
16
  * Creates CSS styles to size the arrow created by createArrowStyles to the given height.
18
17
  *
19
18
  * Use this when you need to create classes for several different arrow sizes. If you only need a
20
19
  * constant arrow size, you can pass the `arrowHeight` param to createArrowStyles instead.
20
+ *
21
+ * @internal
21
22
  */
22
23
  export declare function createArrowHeightStyles(arrowHeight: number): GriffelStyle;
23
24
 
24
25
  /**
25
- * @internal
26
26
  * Helper that creates a makeStyles rule for an arrow element.
27
27
  * For runtime arrow size toggling simply create extra classnames to apply to the arrow element
28
28
  *
@@ -43,12 +43,15 @@ export declare function createArrowHeightStyles(arrowHeight: number): GriffelSty
43
43
  * state.mediumArrow && styles.mediumArrow,
44
44
  * )
45
45
  * ```
46
+ *
47
+ * @internal
46
48
  */
47
49
  export declare function createArrowStyles(options: CreateArrowStylesOptions): GriffelStyle;
48
50
 
49
51
  /**
50
- * @internal
51
52
  * Options parameter for the createArrowStyles function
53
+ *
54
+ * @internal
52
55
  */
53
56
  export declare type CreateArrowStylesOptions = {
54
57
  /**
@@ -82,6 +85,9 @@ export declare type CreateArrowStylesOptions = {
82
85
  * Creates animation styles so that positioned elements slide in from the main axis
83
86
  * @param mainAxis - distance than the element sides for
84
87
  * @returns Griffel styles to spread to a slot
88
+ *
89
+ * @deprecated The popover-related components now use the Slide motion component,
90
+ * which they inject using the `surfaceMotion` slot.
85
91
  */
86
92
  export declare function createSlideStyles(mainAxis: number): GriffelStyle;
87
93
 
@@ -120,8 +126,35 @@ export declare type OffsetObject = {
120
126
 
121
127
  export declare type OffsetShorthand = number;
122
128
 
129
+ /**
130
+ * Custom DOM event dispatched on the positioned container element when a
131
+ * positioning update completes. Carries placement information in `event.detail`.
132
+ */
133
+ declare type OnPositioningEndEvent = CustomEvent<OnPositioningEndEventDetail>;
134
+
135
+ /**
136
+ * Detail payload of the positioning end event, providing the final computed placement
137
+ * after all middleware (flip, shift, etc.) have run.
138
+ */
139
+ declare type OnPositioningEndEventDetail = {
140
+ /**
141
+ * The computed placement of the positioned element. May differ from the requested
142
+ * placement if flip or other middleware adjusted it.
143
+ */
144
+ placement: PositioningPlacement;
145
+ };
146
+
123
147
  export declare type Position = 'above' | 'below' | 'before' | 'after';
124
148
 
149
+ /**
150
+ * CSS custom properties used to encode the slide direction for positioning-aware enter animations.
151
+ * Set at runtime by `usePositioningSlideDirection` and registered via the CSS
152
+ * `registerProperty()` API so browsers can interpolate them as `<length>` values.
153
+ */
154
+ export declare const POSITIONING_SLIDE_DIRECTION_VAR_X = "--fui-positioning-slide-direction-x";
155
+
156
+ export declare const POSITIONING_SLIDE_DIRECTION_VAR_Y = "--fui-positioning-slide-direction-y";
157
+
125
158
  export declare type PositioningBoundary = PositioningRect | HTMLElement | Array<HTMLElement> | 'clippingParents' | 'scrollParent' | 'window';
126
159
 
127
160
  export declare type PositioningConfigurationFn = (params: {
@@ -244,10 +277,11 @@ declare interface PositioningOptions {
244
277
  /**
245
278
  * Called when a position update has finished. Multiple position updates can happen in a single render,
246
279
  * since positioning happens outside of the React lifecycle.
280
+ * The event's `detail.placement` indicates the final computed placement after middleware adjustments.
247
281
  *
248
282
  * It's also possible to listen to the custom DOM event `fui-positioningend`
249
283
  */
250
- onPositioningEnd?: () => void;
284
+ onPositioningEnd?: (e: OnPositioningEndEvent) => void;
251
285
  /**
252
286
  * Disables the resize observer that updates position on target or dimension change
253
287
  */
@@ -259,6 +293,13 @@ declare interface PositioningOptions {
259
293
  shiftToCoverTarget?: boolean;
260
294
  }
261
295
 
296
+ /**
297
+ * Physical placement of a positioned element relative to its target, as computed by Floating UI.
298
+ * This is a Fluent-owned equivalent of Floating UI's `Placement` type, avoiding a transitive
299
+ * dependency on `@floating-ui/dom` in the public API surface.
300
+ */
301
+ declare type PositioningPlacement = 'top' | 'top-start' | 'top-end' | 'right' | 'right-start' | 'right-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end';
302
+
262
303
  /**
263
304
  * Public api that allows components using react-positioning to specify positioning options
264
305
  */
@@ -308,11 +349,11 @@ declare type TargetElement = HTMLElement | PositioningVirtualElement;
308
349
  export declare function usePositioning(options: PositioningProps & PositioningOptions): UsePositioningReturn;
309
350
 
310
351
  /**
311
- * @internal
312
352
  * A state hook that manages a popper virtual element from mouseevents.
313
353
  * Useful for scenarios where a component needs to be positioned by mouse click (e.g. contextmenu)
314
354
  * React synthetic events are not persisted by this hook
315
355
  *
356
+ * @internal
316
357
  * @param initialState - initializes a user provided state similare to useState
317
358
  * @returns state and dispatcher for a Popper virtual element that uses native/synthetic mouse events
318
359
  */
@@ -324,6 +365,24 @@ declare interface UsePositioningReturn {
324
365
  arrowRef: React_2.MutableRefObject<any>;
325
366
  }
326
367
 
368
+ /**
369
+ * A hook that manages CSS custom properties for slide direction based on positioning placement.
370
+ *
371
+ * It wraps the `onPositioningEnd` callback to set `--fui-positioning-slide-direction-x` and
372
+ * `--fui-positioning-slide-direction-y` CSS custom properties on the positioned element,
373
+ * and registers them via `CSS.registerProperty` to avoid properties propagation down to a DOM tree.
374
+ *
375
+ * @returns The wrapped `onPositioningEnd` handler to pass to the positioning config.
376
+ */
377
+ export declare function usePositioningSlideDirection(options: UsePositioningSlideDirectionOptions): NonNullable<PositioningProps['onPositioningEnd']>;
378
+
379
+ declare type UsePositioningSlideDirectionOptions = {
380
+ /** The target document for CSS.registerProperty. */
381
+ targetDocument: Document | undefined;
382
+ /** The user's original onPositioningEnd callback, if any. */
383
+ onPositioningEnd?: PositioningProps['onPositioningEnd'];
384
+ };
385
+
327
386
  export declare function useSafeZoneArea({ debug, disabled, onSafeZoneEnter, onSafeZoneMove, onSafeZoneLeave, onSafeZoneTimeout, timeout, }?: UseSafeZoneOptions): {
328
387
  containerRef: RefObjectFunction<HTMLElement>;
329
388
  targetRef: RefObjectFunction<HTMLElement>;
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import * as React from 'react';
2
+ import * as React from "react";
3
3
  // ---
4
4
  const DEFAULT_CONFIGURATION = ({ options })=>{
5
5
  return options;
package/lib/constants.js CHANGED
@@ -3,3 +3,9 @@ export const DATA_POSITIONING_ESCAPED = 'data-popper-escaped';
3
3
  export const DATA_POSITIONING_HIDDEN = 'data-popper-reference-hidden';
4
4
  export const DATA_POSITIONING_PLACEMENT = 'data-popper-placement';
5
5
  export const POSITIONING_END_EVENT = 'fui-positioningend';
6
+ /**
7
+ * CSS custom properties used to encode the slide direction for positioning-aware enter animations.
8
+ * Set at runtime by `usePositioningSlideDirection` and registered via the CSS
9
+ * `registerProperty()` API so browsers can interpolate them as `<length>` values.
10
+ */ export const POSITIONING_SLIDE_DIRECTION_VAR_X = '--fui-positioning-slide-direction-x';
11
+ export const POSITIONING_SLIDE_DIRECTION_VAR_Y = '--fui-positioning-slide-direction-y';
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/constants.ts"],"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';\nexport const POSITIONING_END_EVENT = 'fui-positioningend';\n"],"names":["DATA_POSITIONING_INTERSECTING","DATA_POSITIONING_ESCAPED","DATA_POSITIONING_HIDDEN","DATA_POSITIONING_PLACEMENT","POSITIONING_END_EVENT"],"mappings":"AAAA,OAAO,MAAMA,gCAAgC,8BAA8B;AAC3E,OAAO,MAAMC,2BAA2B,sBAAsB;AAC9D,OAAO,MAAMC,0BAA0B,+BAA+B;AACtE,OAAO,MAAMC,6BAA6B,wBAAwB;AAClE,OAAO,MAAMC,wBAAwB,qBAAqB"}
1
+ {"version":3,"sources":["../src/constants.ts"],"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';\nexport const POSITIONING_END_EVENT = 'fui-positioningend';\n\n/**\n * CSS custom properties used to encode the slide direction for positioning-aware enter animations.\n * Set at runtime by `usePositioningSlideDirection` and registered via the CSS\n * `registerProperty()` API so browsers can interpolate them as `<length>` values.\n */\nexport const POSITIONING_SLIDE_DIRECTION_VAR_X = '--fui-positioning-slide-direction-x';\nexport const POSITIONING_SLIDE_DIRECTION_VAR_Y = '--fui-positioning-slide-direction-y';\n"],"names":["DATA_POSITIONING_INTERSECTING","DATA_POSITIONING_ESCAPED","DATA_POSITIONING_HIDDEN","DATA_POSITIONING_PLACEMENT","POSITIONING_END_EVENT","POSITIONING_SLIDE_DIRECTION_VAR_X","POSITIONING_SLIDE_DIRECTION_VAR_Y"],"mappings":"AAAA,OAAO,MAAMA,gCAAgC,8BAA8B;AAC3E,OAAO,MAAMC,2BAA2B,sBAAsB;AAC9D,OAAO,MAAMC,0BAA0B,+BAA+B;AACtE,OAAO,MAAMC,6BAA6B,wBAAwB;AAClE,OAAO,MAAMC,wBAAwB,qBAAqB;AAE1D;;;;CAIC,GACD,OAAO,MAAMC,oCAAoC,sCAAsC;AACvF,OAAO,MAAMC,oCAAoC,sCAAsC"}