import "./Listbox.css"; import { AriaLabelingProps, DomProps, FocusManager } from "../../shared"; import { CollectionNode as CollectionNodeAliasForDocumentation } from "../../collection"; import { ComponentProps, ElementType, ForwardedRef, ReactNode, SyntheticEvent } from "react"; export declare const OptionKeyProp = "data-o-ui-key"; declare type SelectionMode = "none" | "single" | "multiple"; interface CollectionNode extends CollectionNodeAliasForDocumentation { } export interface InnerListboxProps extends DomProps, AriaLabelingProps { /** * Called when the focus change. * @param {SyntheticEvent} event - React's original event. * @param {String[]} keys - The keys of the selected items. * @returns {void} */ onFocusChange?: (event: SyntheticEvent, key: string, activeElement: HTMLElement) => void; /** * A controlled set of the selected item keys. */ selectedKeys?: string[] | null; /** * The initial value of `selectedKeys` when uncontrolled. */ defaultSelectedKeys?: string[]; /** * Whether or not the listbox should display as "valid" or "invalid". */ validationState?: "valid" | "invalid"; /** * Called when the selected keys change. * @param {SyntheticEvent} event - React's original event. * @param {String[]} keys - The keys of the selected items. * @returns {void} */ onSelectionChange?: (event: SyntheticEvent, key: string[]) => void; /** * The type of selection that is allowed. */ selectionMode?: SelectionMode; /** * A collection of nodes to render instead of children. It should only be used if you embed a Listbox inside another component like a custom Select. */ nodes?: CollectionNode[]; /** * Whether or not the listbox should autofocus on render. */ autoFocus?: boolean | number; /** * Default focus target when enabling autofocus. */ defaultFocusTarget?: string; /** * Whether or not to focus the hovered item. */ focusOnHover?: boolean; /** * Whether or not focus should be virtual (add a CSS class instead of switching the active element). */ useVirtualFocus?: boolean; /** * Whether or not the listbox option should be reachable with tabs. */ tabbable?: boolean; /** * Whether or not the listbox take up the width of its container. */ fluid?: boolean; /** * An HTML element type or a custom React element type to render as. */ as?: ElementType; /** * @ignore */ children?: ReactNode; /** * @ignore */ forwardedRef: ForwardedRef; } export declare function InnerListbox({ id, selectedKeys: selectedKeysProp, defaultSelectedKeys, validationState, onSelectionChange, onFocusChange, selectionMode, nodes: nodesProp, autoFocus, defaultFocusTarget, focusOnHover, useVirtualFocus, tabbable, fluid, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, as, children, forwardedRef, ...rest }: InnerListboxProps): JSX.Element; export declare type ListboxElement = HTMLElement & { focusManager?: FocusManager; }; export declare const Listbox: import("../../shared").OrbitComponent; export declare type ListboxProps = ComponentProps; export {};