@loke/ui
Version:
26 lines (25 loc) • 1.54 kB
TypeScript
import { Primitive } from "@loke/ui/primitive";
import { type ComponentPropsWithoutRef } from "react";
declare const createCheckboxScope: import("@loke/ui/context").CreateScope;
type CheckedState = boolean | "indeterminate";
type PrimitiveButtonProps = ComponentPropsWithoutRef<typeof Primitive.button>;
interface CheckboxProps extends Omit<PrimitiveButtonProps, "checked" | "defaultChecked"> {
checked?: CheckedState;
defaultChecked?: CheckedState;
onCheckedChange?(checked: CheckedState): void;
required?: boolean;
}
declare const Checkbox: import("react").ForwardRefExoticComponent<CheckboxProps & import("react").RefAttributes<HTMLButtonElement>>;
type PrimitiveSpanProps = ComponentPropsWithoutRef<typeof Primitive.span>;
interface CheckboxIndicatorProps extends PrimitiveSpanProps {
/**
* Used to force mounting when more control is needed. Useful when
* controlling animation with React animation libraries.
*/
forceMount?: true;
}
declare const CheckboxIndicator: import("react").ForwardRefExoticComponent<CheckboxIndicatorProps & import("react").RefAttributes<HTMLSpanElement>>;
declare const Root: import("react").ForwardRefExoticComponent<CheckboxProps & import("react").RefAttributes<HTMLButtonElement>>;
declare const Indicator: import("react").ForwardRefExoticComponent<CheckboxIndicatorProps & import("react").RefAttributes<HTMLSpanElement>>;
export { createCheckboxScope, Checkbox, CheckboxIndicator, Root, Indicator, };
export type { CheckboxProps, CheckboxIndicatorProps, CheckedState };