import { CollectionNode } from "../../collection"; import { ComponentProps, SyntheticEvent } from "react"; import { FocusManager, InternalProps, OmitInternalProps, StyledComponentProps } from "../../shared"; import { ResponsiveProp } from "../../styling"; import { ValidationState } from "../../input"; export declare const OptionKeyProp = "data-o-ui-key"; export declare type ListboxSelectionMode = "none" | "single" | "multiple"; declare const DefaultElement = "div"; export interface InnerListboxProps extends InternalProps, StyledComponentProps { /** * Whether or not the listbox should autofocus on render. */ autoFocus?: boolean | number; /** * Default focus target on autofocus. */ autoFocusTarget?: string; /** * The initial value of `selectedKeys` when uncontrolled. */ defaultSelectedKeys?: string[]; /** * Whether or not the listbox options are disabled. */ disabled?: boolean; /** * Whether or not the listbox take up the width of its container. */ fluid?: ResponsiveProp; /** * Whether or not to focus the hovered item. */ focusOnHover?: boolean; /** * 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[]; /** * 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; /** * 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; /** * A controlled set of the selected item keys. */ selectedKeys?: string[] | null; /** * The type of selection that is allowed. */ selectionMode?: ListboxSelectionMode; /** * Whether or not the listbox option should be reachable with tabs. */ tabbable?: 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 should display as "valid" or "invalid". */ validationState?: ValidationState; } export declare function InnerListbox({ "aria-label": ariaLabel, "aria-labelledby": ariaLabelledBy, as, autoFocus, autoFocusTarget, children, defaultSelectedKeys, fluid, focusOnHover, forwardedRef, id, nodes: nodesProp, onFocusChange, onSelectionChange, selectedKeys: selectedKeysProp, selectionMode, tabbable, useVirtualFocus, validationState, ...rest }: InnerListboxProps): JSX.Element; export declare namespace InnerListbox { var defaultElement: string; } export declare type ListboxElement = HTMLElement & { focusManager: FocusManager; }; /** * A listbox presents a list of options and allows a user to select one or more of them * * [Documentation](https://orbit.sharegate.design/?path=/docs/listbox--default-story) */ export declare const Listbox: import("react").ForwardRefExoticComponent, "ref"> & import("react").RefAttributes>; export declare type ListboxProps = ComponentProps; export {};