UNPKG

react-dropdown-aria-jesus

Version:

Simple and accessible React dropdown component

36 lines (35 loc) 1.7 kB
import React from "react"; import { DropdownProps, ExtraState, Option, DropdownOption } from './types'; export declare const useDropdownHooks: (props: DropdownProps, mergedId: string) => { focusedIndex: number; setFocusedIndex: React.Dispatch<React.SetStateAction<number>>; open: boolean; setOpen: React.Dispatch<React.SetStateAction<boolean>>; searchTerm: string; setSearchTerm: (newSearchTerm: string, resetFocusedIndex?: any) => void; dropdownFocused: boolean; setDropdownFocused: React.Dispatch<React.SetStateAction<boolean>>; setValue: (newOption?: Option | undefined, shouldClose?: any) => void; filteredOptions: DropdownOption[]; getStyle: (key: "Arrow" | "DropdownSelector" | "DropdownWrapper" | "SelectorSearch" | "SelectedValue" | "Placeholder" | "GroupContainer" | "GroupDivider" | "GroupHeading" | "OptionContainer" | "OptionItem" | "IconContainer" | "Loader", extraState?: ExtraState | undefined) => string; openDropdown: () => void; closeDropdown: (focus?: any) => void; flattenedOptions: Option[]; container: React.RefObject<HTMLDivElement>; inputRef: React.RefObject<HTMLInputElement>; listWrapper: React.RefObject<HTMLDivElement>; ariaProps: { 'aria-hidden': boolean; 'aria-expanded': boolean; 'aria-haspopup': "listbox"; 'aria-activedescendant': string; 'aria-controls': string; 'aria-owns': string; 'aria-label': string; 'aria-labelledby': string; 'aria-describedby': string; 'aria-required': boolean; }; ariaList: JSX.Element; }; export declare const useId: (idProp: string) => string;