@atlaskit/top-layer 0.1.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 (300) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +151 -0
  3. package/animations/package.json +17 -0
  4. package/arrow/package.json +17 -0
  5. package/create-close-event/package.json +17 -0
  6. package/dialog/package.json +17 -0
  7. package/dialog-scroll-lock/package.json +17 -0
  8. package/dist/cjs/animations/presets.js +199 -0
  9. package/dist/cjs/animations/types.js +5 -0
  10. package/dist/cjs/arrow/index.js +130 -0
  11. package/dist/cjs/arrow/types.js +5 -0
  12. package/dist/cjs/dialog/create-close-event.js +39 -0
  13. package/dist/cjs/dialog/dialog-content.compiled.css +14 -0
  14. package/dist/cjs/dialog/dialog-content.js +144 -0
  15. package/dist/cjs/dialog/index.js +19 -0
  16. package/dist/cjs/dialog/types.js +5 -0
  17. package/dist/cjs/dialog-scroll-lock/index.js +46 -0
  18. package/dist/cjs/entry-points/animations.js +36 -0
  19. package/dist/cjs/entry-points/arrow.js +12 -0
  20. package/dist/cjs/entry-points/create-close-event.js +19 -0
  21. package/dist/cjs/entry-points/dialog-scroll-lock.js +12 -0
  22. package/dist/cjs/entry-points/dialog.js +12 -0
  23. package/dist/cjs/entry-points/focus.js +24 -0
  24. package/dist/cjs/entry-points/placement-map.js +18 -0
  25. package/dist/cjs/entry-points/popover.js +12 -0
  26. package/dist/cjs/entry-points/popup-surface.js +12 -0
  27. package/dist/cjs/entry-points/popup.js +12 -0
  28. package/dist/cjs/entry-points/use-anchor-position.js +12 -0
  29. package/dist/cjs/entry-points/use-arrow-navigation.js +18 -0
  30. package/dist/cjs/entry-points/use-simple-light-dismiss.js +12 -0
  31. package/dist/cjs/focus/focus.js +115 -0
  32. package/dist/cjs/focus/index.js +24 -0
  33. package/dist/cjs/index.js +8 -0
  34. package/dist/cjs/internal/anchor-positioning-fallback.js +154 -0
  35. package/dist/cjs/internal/combine.js +29 -0
  36. package/dist/cjs/internal/ensure-preset-styles.js +34 -0
  37. package/dist/cjs/internal/reduced-motion.js +27 -0
  38. package/dist/cjs/internal/resolve-placement.js +24 -0
  39. package/dist/cjs/internal/role-types.js +66 -0
  40. package/dist/cjs/internal/set-style.js +42 -0
  41. package/dist/cjs/internal/slot.js +65 -0
  42. package/dist/cjs/internal/use-anchor-positioning.js +336 -0
  43. package/dist/cjs/internal/use-animated-visibility.js +169 -0
  44. package/dist/cjs/internal/use-animation-preset.js +24 -0
  45. package/dist/cjs/internal/use-focus-wrap.js +94 -0
  46. package/dist/cjs/internal/use-initial-focus.js +112 -0
  47. package/dist/cjs/internal/use-preset-styles.js +27 -0
  48. package/dist/cjs/placement-map/index.js +147 -0
  49. package/dist/cjs/popover/create-close-event.js +44 -0
  50. package/dist/cjs/popover/index.js +19 -0
  51. package/dist/cjs/popover/popover.compiled.css +13 -0
  52. package/dist/cjs/popover/popover.js +251 -0
  53. package/dist/cjs/popover/types.js +5 -0
  54. package/dist/cjs/popup/index.js +37 -0
  55. package/dist/cjs/popup/popup-content.js +201 -0
  56. package/dist/cjs/popup/popup-context.js +42 -0
  57. package/dist/cjs/popup/popup-surface.compiled.css +5 -0
  58. package/dist/cjs/popup/popup-surface.js +30 -0
  59. package/dist/cjs/popup/popup-trigger-function.js +74 -0
  60. package/dist/cjs/popup/popup-trigger.js +82 -0
  61. package/dist/cjs/popup/popup.js +70 -0
  62. package/dist/cjs/popup/types.js +5 -0
  63. package/dist/cjs/use-arrow-navigation/index.js +18 -0
  64. package/dist/cjs/use-arrow-navigation/use-arrow-navigation.js +245 -0
  65. package/dist/cjs/use-simple-light-dismiss/index.js +84 -0
  66. package/dist/es2019/animations/presets.js +375 -0
  67. package/dist/es2019/animations/types.js +1 -0
  68. package/dist/es2019/arrow/index.js +249 -0
  69. package/dist/es2019/arrow/types.js +1 -0
  70. package/dist/es2019/dialog/create-close-event.js +34 -0
  71. package/dist/es2019/dialog/dialog-content.compiled.css +14 -0
  72. package/dist/es2019/dialog/dialog-content.js +138 -0
  73. package/dist/es2019/dialog/index.js +2 -0
  74. package/dist/es2019/dialog/types.js +1 -0
  75. package/dist/es2019/dialog-scroll-lock/index.js +41 -0
  76. package/dist/es2019/entry-points/animations.js +1 -0
  77. package/dist/es2019/entry-points/arrow.js +1 -0
  78. package/dist/es2019/entry-points/create-close-event.js +2 -0
  79. package/dist/es2019/entry-points/dialog-scroll-lock.js +1 -0
  80. package/dist/es2019/entry-points/dialog.js +1 -0
  81. package/dist/es2019/entry-points/focus.js +1 -0
  82. package/dist/es2019/entry-points/placement-map.js +1 -0
  83. package/dist/es2019/entry-points/popover.js +1 -0
  84. package/dist/es2019/entry-points/popup-surface.js +1 -0
  85. package/dist/es2019/entry-points/popup.js +1 -0
  86. package/dist/es2019/entry-points/use-anchor-position.js +1 -0
  87. package/dist/es2019/entry-points/use-arrow-navigation.js +1 -0
  88. package/dist/es2019/entry-points/use-simple-light-dismiss.js +1 -0
  89. package/dist/es2019/focus/focus.js +107 -0
  90. package/dist/es2019/focus/index.js +1 -0
  91. package/dist/es2019/index.js +7 -0
  92. package/dist/es2019/internal/anchor-positioning-fallback.js +153 -0
  93. package/dist/es2019/internal/combine.js +18 -0
  94. package/dist/es2019/internal/ensure-preset-styles.js +29 -0
  95. package/dist/es2019/internal/reduced-motion.js +21 -0
  96. package/dist/es2019/internal/resolve-placement.js +19 -0
  97. package/dist/es2019/internal/role-types.js +61 -0
  98. package/dist/es2019/internal/set-style.js +39 -0
  99. package/dist/es2019/internal/slot.js +57 -0
  100. package/dist/es2019/internal/use-anchor-positioning.js +330 -0
  101. package/dist/es2019/internal/use-animated-visibility.js +159 -0
  102. package/dist/es2019/internal/use-animation-preset.js +18 -0
  103. package/dist/es2019/internal/use-focus-wrap.js +90 -0
  104. package/dist/es2019/internal/use-initial-focus.js +109 -0
  105. package/dist/es2019/internal/use-preset-styles.js +22 -0
  106. package/dist/es2019/placement-map/index.js +142 -0
  107. package/dist/es2019/popover/create-close-event.js +39 -0
  108. package/dist/es2019/popover/index.js +2 -0
  109. package/dist/es2019/popover/popover.compiled.css +13 -0
  110. package/dist/es2019/popover/popover.js +240 -0
  111. package/dist/es2019/popover/types.js +1 -0
  112. package/dist/es2019/popup/index.js +33 -0
  113. package/dist/es2019/popup/popup-content.js +192 -0
  114. package/dist/es2019/popup/popup-context.js +34 -0
  115. package/dist/es2019/popup/popup-surface.compiled.css +5 -0
  116. package/dist/es2019/popup/popup-surface.js +24 -0
  117. package/dist/es2019/popup/popup-trigger-function.js +69 -0
  118. package/dist/es2019/popup/popup-trigger.js +76 -0
  119. package/dist/es2019/popup/popup.js +56 -0
  120. package/dist/es2019/popup/types.js +1 -0
  121. package/dist/es2019/use-arrow-navigation/index.js +1 -0
  122. package/dist/es2019/use-arrow-navigation/use-arrow-navigation.js +238 -0
  123. package/dist/es2019/use-simple-light-dismiss/index.js +79 -0
  124. package/dist/esm/animations/presets.js +190 -0
  125. package/dist/esm/animations/types.js +1 -0
  126. package/dist/esm/arrow/index.js +123 -0
  127. package/dist/esm/arrow/types.js +1 -0
  128. package/dist/esm/dialog/create-close-event.js +33 -0
  129. package/dist/esm/dialog/dialog-content.compiled.css +14 -0
  130. package/dist/esm/dialog/dialog-content.js +135 -0
  131. package/dist/esm/dialog/index.js +2 -0
  132. package/dist/esm/dialog/types.js +1 -0
  133. package/dist/esm/dialog-scroll-lock/index.js +41 -0
  134. package/dist/esm/entry-points/animations.js +1 -0
  135. package/dist/esm/entry-points/arrow.js +1 -0
  136. package/dist/esm/entry-points/create-close-event.js +2 -0
  137. package/dist/esm/entry-points/dialog-scroll-lock.js +1 -0
  138. package/dist/esm/entry-points/dialog.js +1 -0
  139. package/dist/esm/entry-points/focus.js +1 -0
  140. package/dist/esm/entry-points/placement-map.js +1 -0
  141. package/dist/esm/entry-points/popover.js +1 -0
  142. package/dist/esm/entry-points/popup-surface.js +1 -0
  143. package/dist/esm/entry-points/popup.js +1 -0
  144. package/dist/esm/entry-points/use-anchor-position.js +1 -0
  145. package/dist/esm/entry-points/use-arrow-navigation.js +1 -0
  146. package/dist/esm/entry-points/use-simple-light-dismiss.js +1 -0
  147. package/dist/esm/focus/focus.js +107 -0
  148. package/dist/esm/focus/index.js +1 -0
  149. package/dist/esm/index.js +7 -0
  150. package/dist/esm/internal/anchor-positioning-fallback.js +147 -0
  151. package/dist/esm/internal/combine.js +23 -0
  152. package/dist/esm/internal/ensure-preset-styles.js +28 -0
  153. package/dist/esm/internal/reduced-motion.js +21 -0
  154. package/dist/esm/internal/resolve-placement.js +18 -0
  155. package/dist/esm/internal/role-types.js +60 -0
  156. package/dist/esm/internal/set-style.js +36 -0
  157. package/dist/esm/internal/slot.js +59 -0
  158. package/dist/esm/internal/use-anchor-positioning.js +323 -0
  159. package/dist/esm/internal/use-animated-visibility.js +162 -0
  160. package/dist/esm/internal/use-animation-preset.js +18 -0
  161. package/dist/esm/internal/use-focus-wrap.js +89 -0
  162. package/dist/esm/internal/use-initial-focus.js +107 -0
  163. package/dist/esm/internal/use-preset-styles.js +21 -0
  164. package/dist/esm/placement-map/index.js +141 -0
  165. package/dist/esm/popover/create-close-event.js +38 -0
  166. package/dist/esm/popover/index.js +2 -0
  167. package/dist/esm/popover/popover.compiled.css +13 -0
  168. package/dist/esm/popover/popover.js +242 -0
  169. package/dist/esm/popover/types.js +1 -0
  170. package/dist/esm/popup/index.js +33 -0
  171. package/dist/esm/popup/popup-content.js +192 -0
  172. package/dist/esm/popup/popup-context.js +34 -0
  173. package/dist/esm/popup/popup-surface.compiled.css +5 -0
  174. package/dist/esm/popup/popup-surface.js +23 -0
  175. package/dist/esm/popup/popup-trigger-function.js +69 -0
  176. package/dist/esm/popup/popup-trigger.js +74 -0
  177. package/dist/esm/popup/popup.js +61 -0
  178. package/dist/esm/popup/types.js +1 -0
  179. package/dist/esm/use-arrow-navigation/index.js +1 -0
  180. package/dist/esm/use-arrow-navigation/use-arrow-navigation.js +238 -0
  181. package/dist/esm/use-simple-light-dismiss/index.js +78 -0
  182. package/dist/types/animations/presets.d.ts +94 -0
  183. package/dist/types/animations/types.d.ts +42 -0
  184. package/dist/types/arrow/index.d.ts +24 -0
  185. package/dist/types/arrow/types.d.ts +29 -0
  186. package/dist/types/dialog/create-close-event.d.ts +24 -0
  187. package/dist/types/dialog/dialog-content.d.ts +20 -0
  188. package/dist/types/dialog/index.d.ts +3 -0
  189. package/dist/types/dialog/types.d.ts +92 -0
  190. package/dist/types/dialog-scroll-lock/index.d.ts +24 -0
  191. package/dist/types/entry-points/animations.d.ts +2 -0
  192. package/dist/types/entry-points/arrow.d.ts +2 -0
  193. package/dist/types/entry-points/create-close-event.d.ts +4 -0
  194. package/dist/types/entry-points/dialog-scroll-lock.d.ts +1 -0
  195. package/dist/types/entry-points/dialog.d.ts +2 -0
  196. package/dist/types/entry-points/focus.d.ts +2 -0
  197. package/dist/types/entry-points/placement-map.d.ts +2 -0
  198. package/dist/types/entry-points/popover.d.ts +2 -0
  199. package/dist/types/entry-points/popup-surface.d.ts +2 -0
  200. package/dist/types/entry-points/popup.d.ts +2 -0
  201. package/dist/types/entry-points/use-anchor-position.d.ts +1 -0
  202. package/dist/types/entry-points/use-arrow-navigation.d.ts +2 -0
  203. package/dist/types/entry-points/use-simple-light-dismiss.d.ts +2 -0
  204. package/dist/types/focus/focus.d.ts +42 -0
  205. package/dist/types/focus/index.d.ts +2 -0
  206. package/dist/types/index.d.ts +0 -0
  207. package/dist/types/internal/anchor-positioning-fallback.d.ts +24 -0
  208. package/dist/types/internal/combine.d.ts +14 -0
  209. package/dist/types/internal/ensure-preset-styles.d.ts +6 -0
  210. package/dist/types/internal/reduced-motion.d.ts +14 -0
  211. package/dist/types/internal/resolve-placement.d.ts +16 -0
  212. package/dist/types/internal/role-types.d.ts +62 -0
  213. package/dist/types/internal/set-style.d.ts +28 -0
  214. package/dist/types/internal/slot.d.ts +29 -0
  215. package/dist/types/internal/use-anchor-positioning.d.ts +95 -0
  216. package/dist/types/internal/use-animated-visibility.d.ts +74 -0
  217. package/dist/types/internal/use-animation-preset.d.ts +11 -0
  218. package/dist/types/internal/use-focus-wrap.d.ts +20 -0
  219. package/dist/types/internal/use-initial-focus.d.ts +21 -0
  220. package/dist/types/internal/use-preset-styles.d.ts +15 -0
  221. package/dist/types/placement-map/index.d.ts +55 -0
  222. package/dist/types/popover/create-close-event.d.ts +26 -0
  223. package/dist/types/popover/index.d.ts +3 -0
  224. package/dist/types/popover/popover.d.ts +22 -0
  225. package/dist/types/popover/types.d.ts +153 -0
  226. package/dist/types/popup/index.d.ts +34 -0
  227. package/dist/types/popup/popup-content.d.ts +14 -0
  228. package/dist/types/popup/popup-context.d.ts +96 -0
  229. package/dist/types/popup/popup-surface.d.ts +16 -0
  230. package/dist/types/popup/popup-trigger-function.d.ts +108 -0
  231. package/dist/types/popup/popup-trigger.d.ts +23 -0
  232. package/dist/types/popup/popup.d.ts +14 -0
  233. package/dist/types/popup/types.d.ts +289 -0
  234. package/dist/types/use-arrow-navigation/index.d.ts +2 -0
  235. package/dist/types/use-arrow-navigation/use-arrow-navigation.d.ts +136 -0
  236. package/dist/types/use-simple-light-dismiss/index.d.ts +45 -0
  237. package/dist/types-ts4.5/animations/presets.d.ts +94 -0
  238. package/dist/types-ts4.5/animations/types.d.ts +42 -0
  239. package/dist/types-ts4.5/arrow/index.d.ts +24 -0
  240. package/dist/types-ts4.5/arrow/types.d.ts +29 -0
  241. package/dist/types-ts4.5/dialog/create-close-event.d.ts +24 -0
  242. package/dist/types-ts4.5/dialog/dialog-content.d.ts +20 -0
  243. package/dist/types-ts4.5/dialog/index.d.ts +3 -0
  244. package/dist/types-ts4.5/dialog/types.d.ts +92 -0
  245. package/dist/types-ts4.5/dialog-scroll-lock/index.d.ts +24 -0
  246. package/dist/types-ts4.5/entry-points/animations.d.ts +2 -0
  247. package/dist/types-ts4.5/entry-points/arrow.d.ts +2 -0
  248. package/dist/types-ts4.5/entry-points/create-close-event.d.ts +4 -0
  249. package/dist/types-ts4.5/entry-points/dialog-scroll-lock.d.ts +1 -0
  250. package/dist/types-ts4.5/entry-points/dialog.d.ts +2 -0
  251. package/dist/types-ts4.5/entry-points/focus.d.ts +2 -0
  252. package/dist/types-ts4.5/entry-points/placement-map.d.ts +2 -0
  253. package/dist/types-ts4.5/entry-points/popover.d.ts +2 -0
  254. package/dist/types-ts4.5/entry-points/popup-surface.d.ts +2 -0
  255. package/dist/types-ts4.5/entry-points/popup.d.ts +2 -0
  256. package/dist/types-ts4.5/entry-points/use-anchor-position.d.ts +1 -0
  257. package/dist/types-ts4.5/entry-points/use-arrow-navigation.d.ts +2 -0
  258. package/dist/types-ts4.5/entry-points/use-simple-light-dismiss.d.ts +2 -0
  259. package/dist/types-ts4.5/focus/focus.d.ts +42 -0
  260. package/dist/types-ts4.5/focus/index.d.ts +2 -0
  261. package/dist/types-ts4.5/index.d.ts +0 -0
  262. package/dist/types-ts4.5/internal/anchor-positioning-fallback.d.ts +24 -0
  263. package/dist/types-ts4.5/internal/combine.d.ts +14 -0
  264. package/dist/types-ts4.5/internal/ensure-preset-styles.d.ts +6 -0
  265. package/dist/types-ts4.5/internal/reduced-motion.d.ts +14 -0
  266. package/dist/types-ts4.5/internal/resolve-placement.d.ts +16 -0
  267. package/dist/types-ts4.5/internal/role-types.d.ts +62 -0
  268. package/dist/types-ts4.5/internal/set-style.d.ts +28 -0
  269. package/dist/types-ts4.5/internal/slot.d.ts +29 -0
  270. package/dist/types-ts4.5/internal/use-anchor-positioning.d.ts +95 -0
  271. package/dist/types-ts4.5/internal/use-animated-visibility.d.ts +74 -0
  272. package/dist/types-ts4.5/internal/use-animation-preset.d.ts +11 -0
  273. package/dist/types-ts4.5/internal/use-focus-wrap.d.ts +20 -0
  274. package/dist/types-ts4.5/internal/use-initial-focus.d.ts +21 -0
  275. package/dist/types-ts4.5/internal/use-preset-styles.d.ts +15 -0
  276. package/dist/types-ts4.5/placement-map/index.d.ts +55 -0
  277. package/dist/types-ts4.5/popover/create-close-event.d.ts +26 -0
  278. package/dist/types-ts4.5/popover/index.d.ts +3 -0
  279. package/dist/types-ts4.5/popover/popover.d.ts +22 -0
  280. package/dist/types-ts4.5/popover/types.d.ts +153 -0
  281. package/dist/types-ts4.5/popup/index.d.ts +34 -0
  282. package/dist/types-ts4.5/popup/popup-content.d.ts +14 -0
  283. package/dist/types-ts4.5/popup/popup-context.d.ts +96 -0
  284. package/dist/types-ts4.5/popup/popup-surface.d.ts +16 -0
  285. package/dist/types-ts4.5/popup/popup-trigger-function.d.ts +108 -0
  286. package/dist/types-ts4.5/popup/popup-trigger.d.ts +23 -0
  287. package/dist/types-ts4.5/popup/popup.d.ts +14 -0
  288. package/dist/types-ts4.5/popup/types.d.ts +289 -0
  289. package/dist/types-ts4.5/use-arrow-navigation/index.d.ts +2 -0
  290. package/dist/types-ts4.5/use-arrow-navigation/use-arrow-navigation.d.ts +136 -0
  291. package/dist/types-ts4.5/use-simple-light-dismiss/index.d.ts +45 -0
  292. package/focus/package.json +17 -0
  293. package/package.json +95 -0
  294. package/placement-map/package.json +17 -0
  295. package/popover/package.json +17 -0
  296. package/popup/package.json +17 -0
  297. package/popup-surface/package.json +17 -0
  298. package/use-anchor-position/package.json +17 -0
  299. package/use-arrow-navigation/package.json +17 -0
  300. package/use-simple-light-dismiss/package.json +17 -0
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @jsxRuntime classic
3
+ * @jsx jsx
4
+ */
5
+ import React from 'react';
6
+ import { type TDialogProps } from './types';
7
+ /**
8
+ * Low-level `<dialog>` primitive. No visual opinions — no width, height,
9
+ * background, border-radius, or layout. Consumers provide their own styling.
10
+ *
11
+ * Visibility is controlled declaratively via `isOpen`:
12
+ * - `isOpen={true}` calls `.showModal()` (entry animation via `@starting-style`)
13
+ * - `isOpen={false}` calls `.close()` (exit animation via `allow-discrete`)
14
+ *
15
+ * Handles native `cancel` event (Escape) and backdrop click detection.
16
+ *
17
+ * Close flow: we never call `dialog.close()` from event handlers. We always call
18
+ * `onClose`; the consumer decides whether to set `isOpen={false}`.
19
+ */
20
+ export declare const Dialog: React.ForwardRefExoticComponent<TDialogProps & React.RefAttributes<HTMLDialogElement>>;
@@ -0,0 +1,3 @@
1
+ export { createCloseEvent } from './create-close-event';
2
+ export { Dialog } from './dialog-content';
3
+ export type { TDialogCloseReason, TDialogProps } from './types';
@@ -0,0 +1,92 @@
1
+ import { type CSSProperties, type ReactNode } from 'react';
2
+ import { type TAnimationPreset } from '../animations/types';
3
+ /**
4
+ * Close reasons produced by the Dialog primitive.
5
+ *
6
+ * - `'escape'` — user pressed Escape (native `cancel` event on `<dialog>`).
7
+ * - `'overlay-click'` — user clicked the backdrop / overlay area.
8
+ *
9
+ * Consumer-initiated ("programmatic") close is not a reason the primitive
10
+ * produces — the consumer simply sets `isOpen={false}`.
11
+ */
12
+ export type TDialogCloseReason = 'escape' | 'overlay-click';
13
+ /**
14
+ * Props for the `Dialog` primitive.
15
+ *
16
+ * Low-level wrapper around the native `<dialog>` element.
17
+ * Manages visibility (`showModal()` / `close()`), animation, Escape handling,
18
+ * and backdrop-click detection. Has no visual opinions — no width, height,
19
+ * background, border-radius, or layout. Consumers (e.g. `@atlaskit/modal-dialog`)
20
+ * provide their own visual styling.
21
+ */
22
+ export type TDialogProps = {
23
+ children: ReactNode;
24
+ /**
25
+ * Whether the dialog is open.
26
+ *
27
+ * - `true`: calls `showModal()`, entry animation plays via `@starting-style`.
28
+ * - `false`: calls `close()`. When an `animate` preset is provided, the exit
29
+ * animation plays (via `allow-discrete`) before the dialog becomes logically closed.
30
+ *
31
+ * The element stays mounted in the DOM — visibility is controlled declaratively.
32
+ */
33
+ isOpen: boolean;
34
+ /**
35
+ * Called when the user triggers close via Escape or backdrop click.
36
+ *
37
+ * The dialog does **not** close itself — the consumer decides whether to
38
+ * set `isOpen={false}` (e.g. gate by reason).
39
+ */
40
+ onClose: (args: {
41
+ reason: TDialogCloseReason;
42
+ }) => void;
43
+ /**
44
+ * Animation preset for entry/exit transitions.
45
+ *
46
+ * Pass an `TAnimationPreset` (e.g. `dialogSlideUpAndFade()`) to enable
47
+ * CSS-based entry and exit animation. Pass `false` (or omit) to disable.
48
+ */
49
+ animate?: TAnimationPreset | false;
50
+ /**
51
+ * Additional inline styles applied to the `<dialog>` element.
52
+ *
53
+ * Use for custom width, height, transform, or other overrides.
54
+ */
55
+ style?: CSSProperties;
56
+ /**
57
+ * Test ID applied to the `<dialog>` element.
58
+ */
59
+ testId?: string;
60
+ /**
61
+ * HTML `id` attribute for the `<dialog>` element.
62
+ */
63
+ id?: string;
64
+ /**
65
+ * Accessible label (`aria-label`).
66
+ *
67
+ * When provided, `aria-labelledby` is not set.
68
+ * Use when there is no visible title element to reference.
69
+ */
70
+ label?: string;
71
+ /**
72
+ * ID of the element that labels the dialog (`aria-labelledby`).
73
+ *
74
+ * Ignored when `label` is provided.
75
+ */
76
+ labelledBy?: string;
77
+ /**
78
+ * When true, the `::backdrop` pseudo-element is rendered transparent.
79
+ *
80
+ * Useful for stacked dialogs where only the foreground dialog should
81
+ * show a visible backdrop, or when the consumer wants no overlay.
82
+ */
83
+ shouldHideBackdrop?: boolean;
84
+ /**
85
+ * Called after the exit animation completes (or immediately on close when
86
+ * there is no animation or reduced motion is active).
87
+ *
88
+ * Use this for external lifecycle coordination — e.g. firing an
89
+ * `onCloseComplete` callback or notifying ExitingPersistence.
90
+ */
91
+ onExitFinish?: () => void;
92
+ };
@@ -0,0 +1,24 @@
1
+ /**
2
+ * __DialogScrollLock__
3
+ *
4
+ * Prevents background page scrolling while mounted. Designed to be rendered
5
+ * inside a `Dialog` so that the scroll lock is automatically removed when the
6
+ * dialog closes (unmounts its children).
7
+ *
8
+ * Native `<dialog>.showModal()` makes background content _inert_ (not
9
+ * focusable/clickable), but does **not** prevent scroll events from reaching
10
+ * the document body. This component fills that gap by setting
11
+ * `overflow: hidden` on `document.body`.
12
+ *
13
+ * @example
14
+ * ```tsx
15
+ * import { Dialog } from '@atlaskit/top-layer/dialog';
16
+ * import { DialogScrollLock } from '@atlaskit/top-layer/dialog-scroll-lock';
17
+ *
18
+ * <Dialog isOpen={isOpen} onClose={onClose}>
19
+ * <DialogScrollLock />
20
+ * {children}
21
+ * </Dialog>
22
+ * ```
23
+ */
24
+ export declare function DialogScrollLock(): null;
@@ -0,0 +1,2 @@
1
+ export { slideAndFade, fade, scaleAndFade, dialogSlideUpAndFade, dialogFade, } from '../animations/presets';
2
+ export type { TAnimationPreset, TPopoverAnimationPreset, TDialogAnimationPreset, } from '../animations/types';
@@ -0,0 +1,2 @@
1
+ export { arrow } from '../arrow';
2
+ export type { TArrowPreset } from '../arrow/types';
@@ -0,0 +1,4 @@
1
+ export { createCloseEvent } from '../dialog';
2
+ export { createPopoverCloseEvent } from '../popover/create-close-event';
3
+ export type { TDialogCloseReason } from '../dialog';
4
+ export type { TPopoverCloseReason } from '../popover';
@@ -0,0 +1 @@
1
+ export { DialogScrollLock } from '../dialog-scroll-lock';
@@ -0,0 +1,2 @@
1
+ export { Dialog } from '../dialog';
2
+ export type { TDialogCloseReason, TDialogProps } from '../dialog';
@@ -0,0 +1,2 @@
1
+ export { getFirstFocusable, getLastFocusable, getNextFocusable } from '../focus';
2
+ export type { TFocusableFilter } from '../focus';
@@ -0,0 +1,2 @@
1
+ export { fromLegacyPlacement, placementMapping } from '../placement-map';
2
+ export type { TLegacyPlacement, TPlacementOptions } from '../placement-map';
@@ -0,0 +1,2 @@
1
+ export { Popover } from '../popover';
2
+ export type { TPopoverProps, TPopoverCloseReason } from '../popover';
@@ -0,0 +1,2 @@
1
+ export { PopupSurface } from '../popup/popup-surface';
2
+ export type { TPopupSurfaceProps } from '../popup/types';
@@ -0,0 +1,2 @@
1
+ export { Popup } from '../popup';
2
+ export type { TPlacementOptions, TPopupProps, TPopupContentProps, TPopupRole, TPopupTriggerProps, TTriggerFunctionRenderProps, } from '../popup';
@@ -0,0 +1 @@
1
+ export { useAnchorPosition } from '../internal/use-anchor-positioning';
@@ -0,0 +1,2 @@
1
+ export { useArrowNavigation, isAtCurrentMenuLevel } from '../use-arrow-navigation';
2
+ export type { TUseArrowNavigationArgs } from '../use-arrow-navigation';
@@ -0,0 +1,2 @@
1
+ export { useSimpleLightDismiss } from '../use-simple-light-dismiss';
2
+ export type { TUseSimpleLightDismissOptions } from '../use-simple-light-dismiss';
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Focusable element selectors and navigation helpers.
3
+ *
4
+ * Uses CSS selectors to discover focusable elements within a container,
5
+ * avoiding the need for a manual registration system. Disabled elements
6
+ * (both HTML `disabled` attribute and `aria-disabled="true"`) and elements
7
+ * with `tabindex="-1"` are excluded automatically.
8
+ *
9
+ * All public functions accept an optional `filter` callback to further
10
+ * restrict which focusable elements are included.
11
+ */
12
+ /**
13
+ * An optional callback to restrict which focusable elements are included.
14
+ * Return `true` to include the element, `false` to skip it.
15
+ */
16
+ export type TFocusableFilter = (element: HTMLElement, container: HTMLElement) => boolean;
17
+ /**
18
+ * Returns the first focusable element within the container.
19
+ */
20
+ export declare function getFirstFocusable({ container, filter, }: {
21
+ container: HTMLElement;
22
+ filter?: TFocusableFilter;
23
+ }): HTMLElement | null;
24
+ /**
25
+ * Returns the last focusable element within the container.
26
+ */
27
+ export declare function getLastFocusable({ container, filter, }: {
28
+ container: HTMLElement;
29
+ filter?: TFocusableFilter;
30
+ }): HTMLElement | null;
31
+ /**
32
+ * Returns the next focusable element in the given direction relative to the
33
+ * currently focused element within the container. Wraps around at both ends.
34
+ *
35
+ * Returns `null` if there is no focused element within the container or if
36
+ * the focused element is not in the list of focusable elements.
37
+ */
38
+ export declare function getNextFocusable({ container, direction, filter, }: {
39
+ container: HTMLElement;
40
+ direction: 'forwards' | 'backwards';
41
+ filter?: TFocusableFilter;
42
+ }): HTMLElement | null;
@@ -0,0 +1,2 @@
1
+ export { getFirstFocusable, getLastFocusable, getNextFocusable } from './focus';
2
+ export type { TFocusableFilter } from './focus';
File without changes
@@ -0,0 +1,24 @@
1
+ import { type TPlacement } from './resolve-placement';
2
+ /**
3
+ * JS fallback: compute popover position from trigger rect and viewport.
4
+ *
5
+ * Placement algorithm (from the document):
6
+ * - "block" placement: show above/below, picking the side with more space if flipping needed
7
+ * - "inline" placement: show left/right, picking the side with more space if flipping needed
8
+ * - "auto" placement: show on the edge with the most available space
9
+ *
10
+ * Re-runs on scroll (capture on window) and resize events.
11
+ */
12
+ export declare function computeFallbackPosition({ triggerRect, popoverEl, placement, viewport, offset, }: {
13
+ triggerRect: DOMRect;
14
+ popoverEl: HTMLElement;
15
+ placement: TPlacement;
16
+ viewport: {
17
+ width: number;
18
+ height: number;
19
+ };
20
+ offset: number;
21
+ }): {
22
+ top: number;
23
+ left: number;
24
+ };
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Combine multiple cleanup functions into a single cleanup function.
3
+ *
4
+ * @example
5
+ * ```ts
6
+ * useEffect(() => {
7
+ * return combine(
8
+ * bind(window, { type: 'resize', listener: onResize }),
9
+ * bind(window, { type: 'scroll', listener: onScroll, options: { capture: true } }),
10
+ * );
11
+ * }, []);
12
+ * ```
13
+ */
14
+ export declare function combine(...cleanupFns: ((() => void) | undefined)[]): () => void;
@@ -0,0 +1,6 @@
1
+ export declare function ensurePresetStyles({ preset }: {
2
+ preset: {
3
+ css: string;
4
+ name: string;
5
+ };
6
+ }): void;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Returns `true` when the user prefers reduced motion.
3
+ *
4
+ * Safe for SSR (returns `false` when `window` is unavailable).
5
+ *
6
+ * The result is cached after the first call via `once`. This avoids
7
+ * calling `matchMedia` on every render. The trade-off is that if a user
8
+ * toggles the OS reduced-motion setting mid-session, the change won't
9
+ * take effect until the next page load. This is acceptable because
10
+ * toggling this system-level preference mid-session is extremely rare,
11
+ * and a page refresh is a reasonable expectation for system accessibility
12
+ * settings to take effect.
13
+ */
14
+ export declare const prefersReducedMotion: () => boolean;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Fully-resolved placement (internal). All fields are required.
3
+ * Use getPlacement({ placement: partial }) to obtain from partial input.
4
+ */
5
+ export type TPlacement = {
6
+ axis: 'block' | 'inline';
7
+ edge: 'start' | 'end';
8
+ align: 'start' | 'center' | 'end';
9
+ };
10
+ /**
11
+ * Resolves a partial placement to its fully-specified form.
12
+ * Defaults: `axis: 'block'`, `edge: 'end'`, `align: 'center'`.
13
+ */
14
+ export declare function getPlacement({ placement }: {
15
+ placement: Partial<TPlacement>;
16
+ }): TPlacement;
@@ -0,0 +1,62 @@
1
+ /**
2
+ * Valid values for the `aria-haspopup` attribute.
3
+ * Derived from the HTML spec — maps popover roles to what the trigger announces.
4
+ */
5
+ export type TAriaHasPopupValue = 'dialog' | 'menu' | 'listbox' | 'tree' | 'grid' | true;
6
+ /**
7
+ * Roles that require an accessible name (`label` or `labelledBy`) per WCAG 4.1.2.
8
+ * Without a name, assistive technology cannot identify these landmarks.
9
+ */
10
+ export type TRoleRequiringAccessibleName = 'dialog' | 'alertdialog' | 'menu';
11
+ /**
12
+ * Roles where the accessible name is derived from content or provided externally
13
+ * (e.g. a combobox labels its listbox, tooltip content IS the accessible name).
14
+ */
15
+ export type TRoleWithImplicitName = 'tooltip' | 'listbox' | 'tree' | 'grid' | 'note' | 'status' | 'alert' | 'log';
16
+ type TAccessibleNameRequired = {
17
+ /**
18
+ * Accessible name via `aria-label`.
19
+ */
20
+ label: string;
21
+ labelledBy?: string;
22
+ } | {
23
+ label?: string;
24
+ /**
25
+ * Accessible name via `aria-labelledby`.
26
+ */
27
+ labelledBy: string;
28
+ };
29
+ type TAccessibleNameOptional = {
30
+ label?: string;
31
+ labelledBy?: string;
32
+ };
33
+ /**
34
+ * ARIA role props where a role is always required.
35
+ *
36
+ * Used by `TPopupContentProps` — popup content must always declare
37
+ * its role so assistive technology can identify the layer.
38
+ */
39
+ export type TAriaRoleRequired = ({
40
+ role: TRoleRequiringAccessibleName;
41
+ } & TAccessibleNameRequired) | ({
42
+ role: TRoleWithImplicitName;
43
+ } & TAccessibleNameOptional);
44
+ /**
45
+ * ARIA role props where a role is optional.
46
+ *
47
+ * Used by `TPopoverProps` — the low-level primitive allows omitting
48
+ * the role for cases where it is set externally or not needed.
49
+ */
50
+ export type TAriaRoleOptional = ({
51
+ role: TRoleRequiringAccessibleName;
52
+ } & TAccessibleNameRequired) | ({
53
+ role?: TRoleWithImplicitName;
54
+ } & TAccessibleNameOptional);
55
+ /**
56
+ * Maps a popover content role to the correct `aria-haspopup` value
57
+ * for its trigger element.
58
+ */
59
+ export declare function roleToAriaHasPopup({ role, }: {
60
+ role: TRoleRequiringAccessibleName | TRoleWithImplicitName | undefined;
61
+ }): TAriaHasPopupValue;
62
+ export {};
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Sets inline styles on an element and returns a cleanup function
3
+ * that removes only the styles that were applied.
4
+ *
5
+ * Uses `style.setProperty()` / `style.removeProperty()` so that
6
+ * hyphenated CSS property names (e.g. `position-area`, `anchor-name`)
7
+ * work correctly. These newer properties do not have camelCase
8
+ * mappings in `CSSStyleDeclaration` yet.
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * const cleanup = setStyle({ el: popover, styles: [
13
+ * { property: 'position-anchor', value: '--my-anchor' },
14
+ * { property: 'position-area', value: 'block-end' },
15
+ * { property: 'margin', value: '0' },
16
+ * ] });
17
+ *
18
+ * // Later: removes all three properties
19
+ * cleanup();
20
+ * ```
21
+ */
22
+ export declare function setStyle({ el, styles, }: {
23
+ el: HTMLElement;
24
+ styles: Array<{
25
+ property: string;
26
+ value: string;
27
+ }>;
28
+ }): () => void;
@@ -0,0 +1,29 @@
1
+ import { type ForwardRefExoticComponent, type ReactNode, type RefAttributes } from 'react';
2
+ /**
3
+ * Extra DOM/event props are passed through to the cloned child.
4
+ */
5
+ export type SlotProps = {
6
+ children: ReactNode;
7
+ } & Record<string, unknown>;
8
+ /**
9
+ * Merges props (including ref) onto a single React element child.
10
+ *
11
+ * A safer alternative to raw `cloneElement` that:
12
+ * 1. Guards with `isValidElement` — non-element children (strings,
13
+ * fragments, null) are returned as-is instead of crashing.
14
+ * 2. Merges refs via `mergeRefs` so both the caller's ref and the
15
+ * child's existing ref are honoured.
16
+ * 3. Spreads any additional props (ARIA attributes, event handlers, etc.)
17
+ * onto the child element.
18
+ *
19
+ * Event handlers (e.g. `onClick`) are **not** auto-merged — the caller's
20
+ * handler replaces the child's. Compose handlers before passing them in.
21
+ *
22
+ * @example
23
+ * ```tsx
24
+ * <Slot ref={triggerRef} onClick={handleClick} aria-expanded={isOpen}>
25
+ * <button>Open</button>
26
+ * </Slot>
27
+ * ```
28
+ */
29
+ export declare const Slot: ForwardRefExoticComponent<SlotProps & RefAttributes<HTMLElement>>;
@@ -0,0 +1,95 @@
1
+ import { type RefObject } from 'react';
2
+ import { type TArrowPreset } from '../arrow/types';
3
+ import { type TPlacementOptions } from '../popup/types';
4
+ export { getPlacement } from './resolve-placement';
5
+ /**
6
+ * Resolves placement options to CSS `position-area` syntax.
7
+ *
8
+ * The `align` field represents the *visual* alignment:
9
+ * - `align: 'start'` means "aligned to the trigger's start edge" (left in LTR for block axis)
10
+ * - `align: 'end'` means "aligned to the trigger's end edge"
11
+ * - `align: 'center'` means centered (single-axis position-area)
12
+ *
13
+ * CSS `position-area` uses `span-*` keywords which indicate the *expansion direction*.
14
+ * Visual start-alignment requires `span-{cross-axis}-end` (expand toward end = start-aligned).
15
+ * This function handles the inversion internally.
16
+ *
17
+ * @example
18
+ * placementToPositionArea({ placement: { axis: 'block', edge: 'end', align: 'center' } }) // → 'block-end'
19
+ * placementToPositionArea({ placement: { axis: 'block', edge: 'end', align: 'start' } }) // → 'block-end span-inline-end'
20
+ * placementToPositionArea({ placement: { axis: 'block', edge: 'end', align: 'end' } }) // → 'block-end span-inline-start'
21
+ */
22
+ export declare function placementToPositionArea({ placement }: {
23
+ placement: TPlacementOptions;
24
+ }): string;
25
+ /**
26
+ * Returns `position-try-fallbacks` value based on placement.
27
+ *
28
+ * For centered placements, includes cross-axis aligned position-area
29
+ * values so the browser can shift the popover along the cross-axis
30
+ * when the centered position would overflow the viewport edge.
31
+ *
32
+ * Fallback order for centered placements (e.g. `block-end`):
33
+ * 1. Same edge, start-aligned (shift for near-edge overflow)
34
+ * 2. Same edge, end-aligned (shift for far-edge overflow)
35
+ * 3. Flipped edge, centered
36
+ * 4. Flipped edge, start-aligned
37
+ * 5. Flipped edge, end-aligned
38
+ *
39
+ * For aligned placements (start/end), includes the same-edge centered
40
+ * position as fallbacks so the browser can try centering when the aligned
41
+ * position would overflow, before flipping to the opposite edge.
42
+ */
43
+ export declare function placementToTryFallbacks({ placement }: {
44
+ placement: TPlacementOptions;
45
+ }): string;
46
+ /**
47
+ * Hook that positions an element relative to an anchor element using
48
+ * CSS Anchor Positioning (with a JS fallback for older browsers).
49
+ *
50
+ * This hook is the positioning primitive — it has no knowledge of popovers,
51
+ * visibility, or animation. Compose it with `Popover` for anchor-positioned
52
+ * top-layer content.
53
+ *
54
+ * When CSS Anchor Positioning is supported, it sets CSS properties
55
+ * (`anchor-name`, `position-anchor`, `position-area`, `position-try-fallbacks`)
56
+ * directly on the elements via `el.style.setProperty()`.
57
+ *
58
+ * When not supported, it falls back to JavaScript-based positioning using
59
+ * `position: fixed` with measured coordinates, re-running on scroll (capture)
60
+ * and resize events.
61
+ */
62
+ export declare function useAnchorPosition({ anchorRef, popoverRef, placement, offset, forceFallbackPositioning, arrow, }: {
63
+ /**
64
+ * Element to position relative to.
65
+ */
66
+ anchorRef: RefObject<HTMLElement | null>;
67
+ /**
68
+ * Element being positioned (typically a popover).
69
+ */
70
+ popoverRef: RefObject<HTMLElement | null>;
71
+ /**
72
+ * Where to place the element relative to the anchor.
73
+ */
74
+ placement: TPlacementOptions;
75
+ /**
76
+ * Gap between the positioned element and the anchor, in pixels.
77
+ * Defaults to 8 (`space.100`). Tooltip uses 4.
78
+ */
79
+ offset?: number;
80
+ /**
81
+ * Forces the JavaScript positioning fallback even when the browser
82
+ * supports CSS Anchor Positioning. Useful for testing fallback
83
+ * behavior in any environment, including production.
84
+ */
85
+ forceFallbackPositioning?: boolean;
86
+ /**
87
+ * Arrow preset from `@atlaskit/top-layer/arrow`. When provided, uses
88
+ * the preset's named `@position-try` rules (which update both
89
+ * `position-area` and `margin` on flip) and sets `--ds-arrow-size`.
90
+ *
91
+ * Pass `null` to disable. Has no effect in the JS fallback path —
92
+ * arrows are CSS-only.
93
+ */
94
+ arrow?: TArrowPreset | null;
95
+ }): void;
@@ -0,0 +1,74 @@
1
+ import { type RefObject } from 'react';
2
+ import { type TAnimationPreset } from '../animations/types';
3
+ type TUseAnimatedVisibilityArgs = {
4
+ /**
5
+ * Whether the element is logically open.
6
+ */
7
+ isOpen: boolean;
8
+ /**
9
+ * Animation preset for entry/exit transitions.
10
+ * Pass `false` or `undefined` to disable animation.
11
+ */
12
+ animate: TAnimationPreset | false | undefined;
13
+ /**
14
+ * Ref to the DOM element that plays the exit transition.
15
+ * Used to listen for `transitionend`.
16
+ */
17
+ elementRef: RefObject<HTMLElement | null>;
18
+ /**
19
+ * Called after the exit animation completes (or immediately on close
20
+ * when there is no animation or reduced motion is active).
21
+ */
22
+ onExitFinish?: () => void;
23
+ };
24
+ type TUseAnimatedVisibilityResult = {
25
+ /**
26
+ * Whether children should be rendered. Stays `true` during exit
27
+ * animations so content remains visible while transitioning out.
28
+ */
29
+ showChildren: boolean;
30
+ /**
31
+ * Resolved animation preset (with CSS injected), or `null` if
32
+ * animation is disabled.
33
+ */
34
+ preset: TAnimationPreset | null;
35
+ };
36
+ /**
37
+ * Manages the children mount/unmount lifecycle around CSS exit transitions.
38
+ *
39
+ * Used by both `Popover` and `Dialog` to share the same animation lifecycle
40
+ * logic. Those components own their own show/hide mechanisms (showPopover /
41
+ * hidePopover vs showModal / close) and event handling — this hook only
42
+ * manages the relationship between `isOpen` and when children are rendered.
43
+ *
44
+ * ## Problem
45
+ *
46
+ * We want to delay the unmount of children until a CSS exit transition has
47
+ * finished playing. If we unmount children the moment `isOpen` becomes
48
+ * `false`, the exit animation is never visible — the content just disappears.
49
+ *
50
+ * ## How it works
51
+ *
52
+ * `showChildren` tracks whether the consumer's children should be in the DOM.
53
+ * It does not mirror `isOpen` exactly — it intentionally lags behind during
54
+ * exit animations:
55
+ *
56
+ * ```
57
+ * isOpen: true ──────────────── false
58
+ * showChildren: true ──────────────── true ─── (exit animation) ─── false
59
+ * ```
60
+ *
61
+ * Two close paths exist:
62
+ *
63
+ * 1. **Animated close** (`willAnimate === true`):
64
+ * `isOpen` goes `false` → `showChildren` stays `true` → the CSS exit
65
+ * transition plays → `transitionend` fires → `showChildren` → `false`
66
+ * → `onExitFinish` fires. A timeout fallback ensures we still unmount
67
+ * if `transitionend` never fires (e.g. browser quirks, zero-duration).
68
+ *
69
+ * 2. **Non-animated close** (`willAnimate === false`):
70
+ * `isOpen` goes `false` → `showChildren` → `false` synchronously during
71
+ * the same render → `onExitFinish` fires in a follow-up effect.
72
+ */
73
+ export declare function useAnimatedVisibility({ isOpen, animate, elementRef, onExitFinish, }: TUseAnimatedVisibilityArgs): TUseAnimatedVisibilityResult;
74
+ export {};
@@ -0,0 +1,11 @@
1
+ type TPresetWithCssAndName = {
2
+ css: string;
3
+ name: string;
4
+ };
5
+ /**
6
+ * Normalizes the `animate` prop to a preset (or null) and ensures its CSS
7
+ * is injected once into document.head. Used by PopupContent, Popover, and
8
+ * DialogContent so they don't duplicate this logic.
9
+ */
10
+ export declare function useAnimationPreset<T extends TPresetWithCssAndName>(animate: T | false | null | undefined): T | null;
11
+ export {};
@@ -0,0 +1,20 @@
1
+ import { type RefObject } from 'react';
2
+ /**
3
+ * Wraps Tab/Shift+Tab focus within a popover element when its role
4
+ * semantically requires it (dialog, alertdialog).
5
+ *
6
+ * While the popover is open, Tab and Shift+Tab are intercepted
7
+ * (via `preventDefault`) and remapped to cycle through focusable
8
+ * elements within the container using wrapping navigation.
9
+ *
10
+ * Light dismiss (Escape, click outside) continues to work natively
11
+ * via `popover="auto"` — this hook only intercepts Tab.
12
+ *
13
+ * Always call this hook unconditionally. The listener is only
14
+ * attached when the role requires focus wrapping, and is cleaned
15
+ * up and re-evaluated when the role changes.
16
+ */
17
+ export declare function useFocusWrap({ elementRef, role, }: {
18
+ elementRef: RefObject<HTMLElement | null>;
19
+ role: string | undefined;
20
+ }): void;