import type { JSX } from "@solidjs/web"; import type { FloatingContext, FloatingRootContext, MutableRef } from "../types.js"; import type { FloatingTreeStore } from "./floating-tree-store.js"; /** * Interaction type used to open / close a floating element. Mirrors * `InteractionType` from `@base-ui/utils/useEnhancedClickHandler`. */ export type InteractionType = "mouse" | "touch" | "pen" | "keyboard" | ""; export interface FloatingFocusManagerProps { children: JSX.Element; /** * The floating context returned from `useFloatingRootContext`. */ context: FloatingRootContext | FloatingContext; /** * The interaction type used to open the floating element. */ openInteractionType?: InteractionType | null | undefined; /** * Whether or not the focus manager should be disabled. Useful to delay * focus management until after a transition completes or some other * conditional state. * @default false */ disabled?: boolean | undefined; /** * Determines the element to focus when the floating element is opened. * * - `false`: Do not move focus. * - `true`: Move focus based on the default behavior (first tabbable * element or floating element). * - `HTMLElement` / `RefObject`: Move focus to that element. * - `function`: Called with the interaction type; returns an element, * `true`, `null`, `false`, or `undefined` to control the behavior. * @default true */ initialFocus?: boolean | HTMLElement | MutableRef | ((openType: InteractionType) => boolean | HTMLElement | null | undefined) | undefined; /** * Determines the element to focus when the floating element is closed. * * Same shape as `initialFocus`. * @default true */ returnFocus?: boolean | HTMLElement | MutableRef | ((closeType: InteractionType) => boolean | HTMLElement | null | undefined) | undefined; /** * Determines where focus should be restored if focus inside the floating * element is lost. * * - `true`: nearest tabbable inside the floating tree. * - `'popup'`: directly to the floating container. * - `false`: no restoration. * @default false */ restoreFocus?: boolean | "popup" | undefined; /** * Determines if focus is "modal", trapping focus fully inside the * floating element. * @default true */ modal?: boolean | undefined; /** * Whether focusout listeners controlling close-on-focus-out are attached * to the reference + floating elements. Mostly affects non-modal focus * management. * @default true */ closeOnFocusOut?: boolean | undefined; /** Overrides the Tab-forward target outside the floating element. */ nextFocusableElement?: HTMLElement | MutableRef | null | undefined; /** Overrides the Shift+Tab target outside the floating element. */ previousFocusableElement?: HTMLElement | MutableRef | null | undefined; /** * Ref to the focus guard preceding the floating content. Useful for * programmatic popup focus. */ beforeContentFocusGuardRef?: MutableRef | undefined; /** * External `FloatingTreeStore` to use when the context-provided one is * not reachable. */ externalTree?: FloatingTreeStore | undefined; /** * Additional elements that should be treated as part of the floating * subtree even if rendered outside the floating element itself. */ getInsideElements?: (() => Array) | undefined; } /** * Provides focus management for the floating element. * @see https://floating-ui.com/docs/FloatingFocusManager * @internal */ export declare function FloatingFocusManager(props: FloatingFocusManagerProps): JSX.Element; //# sourceMappingURL=floating-focus-manager.d.ts.map