Files
NapCatQQ/.pnpm-store/v3/files/1a/678193d802ae42b72189c4c41c44ae6a4bc4bc5635c407993bfb05070c5984844b03edcd8bfd0f75e85ce7e0307fd343521987ab67b4a7ec16eeb781610661
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

72 lines
2.5 KiB
Plaintext

import * as _heroui_system from '@heroui/system';
import { PropGetter, HTMLHeroUIProps } from '@heroui/system';
import { CheckboxVariantProps, SlotsToClasses, CheckboxSlots } from '@heroui/theme';
import { AriaCheckboxProps } from '@react-types/checkbox';
import { ReactNode, Ref } from 'react';
type CheckboxIconProps = {
"data-checked": string;
isSelected: boolean;
isIndeterminate: boolean;
disableAnimation: boolean;
className: string;
};
interface Props extends Omit<HTMLHeroUIProps<"input">, keyof CheckboxVariantProps> {
/**
* Ref to the DOM node.
*/
ref?: Ref<HTMLInputElement>;
/**
* The label of the checkbox.
*/
children?: ReactNode;
/**
* Whether the checkbox is disabled.
* @default false
*/
isDisabled?: boolean;
/**
* The icon to be displayed when the checkbox is checked.
*/
icon?: ReactNode | ((props: CheckboxIconProps) => ReactNode);
/**
* React aria onChange event.
*/
onValueChange?: AriaCheckboxProps["onChange"];
/**
* Classname or List of classes to change the classNames of the element.
* if `className` is passed, it will be added to the base slot.
*
* @example
* ```ts
* <Checkbox classNames={{
* base:"base-classes",
* wrapper: "wrapper-classes",
* icon: "icon-classes",
* label: "label-classes",
* }} />
* ```
*/
classNames?: SlotsToClasses<CheckboxSlots>;
}
type UseCheckboxProps = Omit<Props, "defaultChecked"> & Omit<AriaCheckboxProps, keyof CheckboxVariantProps | "onChange"> & CheckboxVariantProps;
declare function useCheckbox(props?: UseCheckboxProps): {
Component: _heroui_system.As<any>;
icon: ReactNode | ((props: CheckboxIconProps) => ReactNode);
children: ReactNode;
isSelected: boolean;
isDisabled: boolean;
isInvalid: boolean;
isFocused: boolean;
isHovered: boolean;
isFocusVisible: boolean;
getBaseProps: PropGetter<Record<string, unknown>, _heroui_system.DOMAttributes<_heroui_system.DOMElement>>;
getWrapperProps: PropGetter<Record<string, unknown>, _heroui_system.DOMAttributes<_heroui_system.DOMElement>>;
getInputProps: PropGetter<Record<string, unknown>, _heroui_system.DOMAttributes<_heroui_system.DOMElement>>;
getLabelProps: PropGetter<Record<string, unknown>, _heroui_system.DOMAttributes<_heroui_system.DOMElement>>;
getIconProps: () => CheckboxIconProps;
};
type UseCheckboxReturn = ReturnType<typeof useCheckbox>;
export { CheckboxIconProps, UseCheckboxProps, UseCheckboxReturn, useCheckbox };