UNPKG

@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

51 lines (50 loc) 2.58 kB
/// <reference types="react" /> import { PopoverInitialState } from "reakit"; import { InputBase } from "@react-types/shared"; export declare type PickerBaseInitialState = PopoverInitialState & InputBase & { /** * Picker wrapper Id */ pickerId?: string; /** * Dialog Id */ dialogId?: string; /** * Function to be called on picker mousedown * for focusing first tabbable element */ segmentFocus?: () => void; }; export declare const usePickerBaseState: (props?: PickerBaseInitialState) => { baseId: string; unstable_idCountRef: import("react").MutableRefObject<number>; visible: boolean; animated: number | boolean; animating: boolean; setBaseId: import("react").Dispatch<import("react").SetStateAction<string>>; show: () => void; hide: () => void; toggle: () => void; setVisible: import("react").Dispatch<import("react").SetStateAction<boolean>>; setAnimated: import("react").Dispatch<import("react").SetStateAction<number | boolean>>; stopAnimation: () => void; modal: boolean; unstable_disclosureRef: import("react").MutableRefObject<HTMLElement | null>; setModal: import("react").Dispatch<import("react").SetStateAction<boolean>>; unstable_referenceRef: import("react").RefObject<HTMLElement | null>; unstable_popoverRef: import("react").RefObject<HTMLElement | null>; unstable_arrowRef: import("react").RefObject<HTMLElement | null>; unstable_popoverStyles: import("react").CSSProperties; unstable_arrowStyles: import("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: import("react").Dispatch<import("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">>; pickerId: string | undefined; dialogId: string | undefined; isDisabled: boolean | undefined; isReadOnly: boolean | undefined; segmentFocus: (() => void) | undefined; }; export declare type PickerBaseStateReturn = ReturnType<typeof usePickerBaseState>;