@renderlesskit/react
Version:
Collection of headless components/hooks that are accessible, composable, customizable from low level to build your own UI & Design System powered by Reakit
75 lines (74 loc) • 4.49 kB
TypeScript
import * as React from "react";
import { PopoverActions, PopoverInitialState, PopoverState } from "reakit";
import { SelectListStateReturn } from "./SelectListState";
export declare function useSelectPopoverState(select: SelectListStateReturn, { gutter, placement, ...initialState }?: SelectPopoverInitialState): {
visible: boolean;
baseId: string;
unstable_idCountRef: React.MutableRefObject<number>;
animated: number | boolean;
animating: boolean;
setBaseId: React.Dispatch<React.SetStateAction<string>>;
show: () => void;
hide: () => void;
toggle: () => void;
setVisible: React.Dispatch<React.SetStateAction<boolean>>;
setAnimated: React.Dispatch<React.SetStateAction<number | boolean>>;
stopAnimation: () => void;
modal: boolean;
unstable_disclosureRef: React.MutableRefObject<HTMLElement | null>;
setModal: React.Dispatch<React.SetStateAction<boolean>>;
unstable_referenceRef: React.RefObject<HTMLElement | null>;
unstable_popoverRef: React.RefObject<HTMLElement | null>;
unstable_arrowRef: React.RefObject<HTMLElement | null>;
unstable_popoverStyles: React.CSSProperties;
unstable_arrowStyles: React.CSSProperties;
unstable_originalPlacement: "auto" | "left" | "right" | "auto-start" | "auto-end" | "top-start" | "top" | "top-end" | "right-start" | "right-end" | "bottom-end" | "bottom" | "bottom-start" | "left-end" | "left-start";
unstable_update: () => boolean;
placement: "auto" | "left" | "right" | "auto-start" | "auto-end" | "top-start" | "top" | "top-end" | "right-start" | "right-end" | "bottom-end" | "bottom" | "bottom-start" | "left-end" | "left-start";
place: React.Dispatch<React.SetStateAction<"auto" | "left" | "right" | "auto-start" | "auto-end" | "top-start" | "top" | "top-end" | "right-start" | "right-end" | "bottom-end" | "bottom" | "bottom-start" | "left-end" | "left-start">>;
unstable_virtual: boolean;
rtl: boolean;
orientation?: import("reakit/ts/Composite/__utils/types").Orientation | undefined;
currentId?: string | null | undefined;
loop: boolean | import("reakit/ts/Composite/__utils/types").Orientation;
wrap: boolean | import("reakit/ts/Composite/__utils/types").Orientation;
shift: boolean;
unstable_includesBaseElement: boolean;
groups: import("reakit/ts/Composite/__utils/types").Group[];
unstable_moves: number;
unstable_hasActiveWidget: boolean;
menuRole: "dialog" | "grid" | "listbox" | "tree";
items: import("./helpers/types").Item[];
values: string[];
valuesById: import("./SelectBaseState").ValuesById;
selectedValue: string | null;
currentValue: string | undefined;
selectedId?: string | null | undefined;
unregisterItem: (id: string) => void;
registerGroup: (group: import("reakit/ts/Composite/__utils/types").Group) => void;
unregisterGroup: (id: string) => void;
move: (id: string | null) => void;
next: (unstable_allTheWay?: boolean | undefined) => void;
previous: (unstable_allTheWay?: boolean | undefined) => void;
up: (unstable_allTheWay?: boolean | undefined) => void;
down: (unstable_allTheWay?: boolean | undefined) => void;
first: () => void;
last: () => void;
sort: () => void;
unstable_setVirtual: React.Dispatch<React.SetStateAction<boolean>>;
setRTL: React.Dispatch<React.SetStateAction<boolean>>;
setOrientation: React.Dispatch<React.SetStateAction<import("reakit/ts/Composite/__utils/types").Orientation | undefined>>;
setCurrentId: React.Dispatch<React.SetStateAction<string | null | undefined>>;
setLoop: React.Dispatch<React.SetStateAction<boolean | import("reakit/ts/Composite/__utils/types").Orientation>>;
setWrap: React.Dispatch<React.SetStateAction<boolean | import("reakit/ts/Composite/__utils/types").Orientation>>;
setShift: React.Dispatch<React.SetStateAction<boolean>>;
reset: () => void;
unstable_setIncludesBaseElement: React.Dispatch<React.SetStateAction<boolean>>;
unstable_setHasActiveWidget: React.Dispatch<React.SetStateAction<boolean>>;
registerItem: (item: import("./helpers/types").Item) => void;
setSelectedValue: import("reakit-utils/ts").SetState<string | null>;
};
export declare type SelectPopoverState = PopoverState;
export declare type SelectPopoverActions = PopoverActions;
export declare type SelectPopoverInitialState = PopoverInitialState;
export declare type SelectPopoverStateReturn = SelectPopoverState & SelectPopoverActions;