pangea-lib 4.0.507 → 4.0.509
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.
- package/README.md +0 -1
- package/dist/main.cjs.js +1791 -1791
- package/dist/main.css +3 -3
- package/dist/main.es.js +23402 -23313
- package/dist/types/composables/index.d.ts +1 -0
- package/dist/types/composables/use-focus-trap.composable.d.ts +15 -0
- package/package.json +1 -1
- package/dist/styles/font-sizes.styl +0 -6
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { useElementPosition } from './use-element-position.composable';
|
|
2
2
|
export { useFloatingDropdown } from './use-floating-dropdown.composable';
|
|
3
|
+
export { useFocusTrap } from './use-focus-trap.composable';
|
|
3
4
|
export { useScrollListener } from './use-scroll-listener.composable';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
|
|
3
|
+
type MaybeElementRef = Readonly<Ref<HTMLElement | null | undefined>>;
|
|
4
|
+
/**
|
|
5
|
+
* Traps the keyboard tab focus inside an overlay (modal, sidebar, fullscreen)
|
|
6
|
+
* while it is open: focuses the first focusable element on open, cycles Tab /
|
|
7
|
+
* Shift+Tab within the container, pulls focus back in if it ever escapes and
|
|
8
|
+
* restores focus to the previously focused element on close. Pressing Escape
|
|
9
|
+
* triggers `onEscape` (used to close the overlay). The container should have
|
|
10
|
+
* `tabindex="-1"` as a fallback for when it has no focusable children.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useFocusTrap(container: MaybeElementRef, isActive: Readonly<Ref<boolean>>, options?: {
|
|
13
|
+
onEscape?: () => void;
|
|
14
|
+
}): void;
|
|
15
|
+
export {};
|
package/package.json
CHANGED