UNPKG

@loke/ui

Version:
34 lines (33 loc) • 1.67 kB
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>> & { displayName: string; }; 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>> & { displayName: string; }; declare const Root: import("react").ForwardRefExoticComponent<CheckboxProps & import("react").RefAttributes<HTMLButtonElement>> & { displayName: string; }; declare const Indicator: import("react").ForwardRefExoticComponent<CheckboxIndicatorProps & import("react").RefAttributes<HTMLSpanElement>> & { displayName: string; }; export type { CheckboxIndicatorProps, CheckboxProps, CheckedState }; export { Checkbox, CheckboxIndicator, createCheckboxScope, Indicator, Root, };