import { type KeyboardMovementContext, type KeyboardMovementProviderImplementation, type KeyboardMovementProviderOptions } from "./types.js"; /** * @since 6.3.0 */ export declare const DEFAULT_KEYBOARD_MOVEMENT_CONTEXT: Readonly; export declare const KeyboardMovementProvider: import("react").Provider; /** * @since 5.0.0 * @internal */ export declare function useKeyboardMovementContext(): Readonly; /** * Implements the custom keyboard movement behavior throughout react-md. Using * the "Find References" will be the best way to see example usage. * * @example Default Keyboard Movement for any Focusable Element * ```tsx * import { * KeyboardMovementProvider, * useKeyboardMovementProvider, * } from "@react-md/core/movement/useKeyboardMovementProvider"; * import type { ReactElement, ReactNode } from "react"; * * function Example({ children }: { children: ReactNode }): ReactElement { * const { movementContext, movementProps } = useKeyboardMovementProvider(); * * // any focusable element child can be focused with the arrow , home, and * // end keys * return ( * *
* {children} *
*
* ); * } * ``` * * @example Active Descendant Movement * ```tsx * import { * KeyboardMovementProvider, * useKeyboardMovementContext, * useKeyboardMovementProvider, * } from "@react-md/core/movement/useKeyboardMovementProvider"; * import type { ReactElement, ReactNode } from "react"; * import { useId } from "react"; * * function Child(): ReactElement { * const id = useId() * const { activeDescendantId } = useKeyboardMovementContext(); * * return ( *
* Some Content *
* ); * } * * function Example({ children }: { children: ReactNode }): ReactElement { * const { movementContext, movementProps } = useKeyboardMovementProvider({ * loopable: true, * searchable: true, * tabIndexBehavior: "virtual", * }); * * // any focusable element child can be focused with the arrow , home, and * // end keys * return ( * *
* * * *
*
* ); * } * ``` * * @example Roving Tab Index * ```tsx * import { * KeyboardMovementProvider, * useKeyboardMovementContext, * useKeyboardMovementProvider, * } from "@react-md/core/movement/useKeyboardMovementProvider"; * import type { ReactElement, ReactNode } from "react"; * import { useId } from "react"; * * function Child(): ReactElement { * const id = useId() * const { activeDescendantId } = useKeyboardMovementContext(); * * return ( *
* Some Content *
* ); * } * * function Example({ children }: { children: ReactNode }): ReactElement { * const { movementContext, movementProps } = useKeyboardMovementProvider({ * loopable: true, * searchable: true, * tabIndexBehavior: "roving", * }); * * // any focusable element child can be focused with the arrow , home, and * // end keys * return ( * *
* * * *
*
* ); * } * ``` * @since 6.0.0 * @internal */ export declare function useKeyboardMovementProvider(options?: KeyboardMovementProviderOptions): KeyboardMovementProviderImplementation;