UNPKG

carbon-react

Version:

A library of reusable React components for easily building user interfaces.

8 lines (7 loc) 974 B
import { RefObject } from "react"; declare const defaultFocusableSelectors = "button:not([disabled]), [href], input:not([type=\"hidden\"]):not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]"; declare const setElementFocus: (element: HTMLElement) => void; declare const getNextElement: (element: HTMLElement, focusableElements: HTMLElement[], shiftKey: boolean) => HTMLElement | undefined; declare const onTabGuardFocus: (trapWrappers: RefObject<HTMLElement>[], focusableSelectors: string | undefined, position: "top" | "bottom") => (guardWrapperRef: RefObject<HTMLElement>) => () => void; declare const trapFunction: (ev: KeyboardEvent, defaultFocusableElements: HTMLElement[], isWrapperFocused: boolean, focusableSelectors?: string, bespokeTrap?: (event: KeyboardEvent, firstElement?: HTMLElement, lastElement?: HTMLElement) => void) => void; export { defaultFocusableSelectors, getNextElement, setElementFocus, onTabGuardFocus, trapFunction, };