@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
102 lines (101 loc) • 4.87 kB
TypeScript
import * as React from "react";
import { CompositeItemHTMLProps, CompositeItemOptions } from "reakit";
import { RadioStateReturn } from "./RadioState";
export declare type RadioOptions = CompositeItemOptions & Pick<Partial<RadioStateReturn>, "state" | "setState"> & {
/**
* Same as the `value` attribute.
*/
value: string | number;
/**
* Same as the `checked` attribute.
*/
checked?: boolean;
/**
* @private
*/
unstable_checkOnFocus?: boolean;
};
export declare type RadioHTMLProps = CompositeItemHTMLProps & React.InputHTMLAttributes<any>;
export declare type RadioProps = RadioOptions & RadioHTMLProps;
export declare const useRadio: {
(options?: RadioOptions | undefined, htmlProps?: RadioHTMLProps | undefined, unstable_ignoreUseOptions?: boolean | undefined): RadioHTMLProps;
unstable_propsAreEqual: (prev: import("reakit").RoleOptions & {
disabled?: boolean | undefined;
focusable?: boolean | undefined;
} & {
unstable_clickOnEnter?: boolean | undefined;
unstable_clickOnSpace?: boolean | undefined;
} & Pick<Partial<import("reakit").unstable_IdStateReturn>, "baseId" | "unstable_idCountRef"> & {
id?: string | undefined;
} & Pick<Partial<import("reakit").CompositeStateReturn>, "baseId" | "unstable_virtual" | "orientation" | "unstable_moves" | "unstable_hasActiveWidget"> & Pick<import("reakit").CompositeStateReturn, "currentId" | "items" | "registerItem" | "unregisterItem" | "next" | "previous" | "up" | "down" | "first" | "last" | "setCurrentId"> & Pick<Partial<RadioStateReturn>, "state" | "setState"> & {
/**
* Same as the `value` attribute.
*/
value: string | number;
/**
* Same as the `checked` attribute.
*/
checked?: boolean | undefined;
/**
* @private
*/
unstable_checkOnFocus?: boolean | undefined;
} & React.HTMLAttributes<any> & React.RefAttributes<any> & {
wrapElement?: ((element: React.ReactNode) => React.ReactNode) | undefined;
} & {
disabled?: boolean | undefined;
} & React.InputHTMLAttributes<any>, next: import("reakit").RoleOptions & {
disabled?: boolean | undefined;
focusable?: boolean | undefined;
} & {
unstable_clickOnEnter?: boolean | undefined;
unstable_clickOnSpace?: boolean | undefined;
} & Pick<Partial<import("reakit").unstable_IdStateReturn>, "baseId" | "unstable_idCountRef"> & {
id?: string | undefined;
} & Pick<Partial<import("reakit").CompositeStateReturn>, "baseId" | "unstable_virtual" | "orientation" | "unstable_moves" | "unstable_hasActiveWidget"> & Pick<import("reakit").CompositeStateReturn, "currentId" | "items" | "registerItem" | "unregisterItem" | "next" | "previous" | "up" | "down" | "first" | "last" | "setCurrentId"> & Pick<Partial<RadioStateReturn>, "state" | "setState"> & {
/**
* Same as the `value` attribute.
*/
value: string | number;
/**
* Same as the `checked` attribute.
*/
checked?: boolean | undefined;
/**
* @private
*/
unstable_checkOnFocus?: boolean | undefined;
} & React.HTMLAttributes<any> & React.RefAttributes<any> & {
wrapElement?: ((element: React.ReactNode) => React.ReactNode) | undefined;
} & {
disabled?: boolean | undefined;
} & React.InputHTMLAttributes<any>) => boolean;
__keys: readonly any[];
__useOptions: (options: RadioOptions, htmlProps: RadioHTMLProps) => RadioOptions;
};
export declare const Radio: import("../system").Component<"input", import("reakit").RoleOptions & {
disabled?: boolean | undefined;
focusable?: boolean | undefined;
} & {
unstable_clickOnEnter?: boolean | undefined;
unstable_clickOnSpace?: boolean | undefined;
} & Pick<Partial<import("reakit").unstable_IdStateReturn>, "baseId" | "unstable_idCountRef"> & {
id?: string | undefined;
} & Pick<Partial<import("reakit").CompositeStateReturn>, "baseId" | "unstable_virtual" | "orientation" | "unstable_moves" | "unstable_hasActiveWidget"> & Pick<import("reakit").CompositeStateReturn, "currentId" | "items" | "registerItem" | "unregisterItem" | "next" | "previous" | "up" | "down" | "first" | "last" | "setCurrentId"> & Pick<Partial<RadioStateReturn>, "state" | "setState"> & {
/**
* Same as the `value` attribute.
*/
value: string | number;
/**
* Same as the `checked` attribute.
*/
checked?: boolean | undefined;
/**
* @private
*/
unstable_checkOnFocus?: boolean | undefined;
} & React.HTMLAttributes<any> & React.RefAttributes<any> & {
wrapElement?: ((element: React.ReactNode) => React.ReactNode) | undefined;
} & {
disabled?: boolean | undefined;
} & React.InputHTMLAttributes<any>>;