Files
NapCatQQ/.pnpm-store/v3/files/3e/cca1daa5a27344b3b552a0d0f98864a9239182d9140055d1728fff904214eb58ff0f241d1baa0ab8798a2defb2ac5a84cc69af43838f25a6b3f9bb3f9f7cd3
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

72 lines
2.9 KiB
Plaintext

import * as react from 'react';
import * as _heroui_system from '@heroui/system';
import { PropGetter, HTMLHeroUIProps } from '@heroui/system';
import { SlotsToClasses, CheckboxGroupSlots } from '@heroui/theme';
import { AriaCheckboxGroupProps } from '@react-types/checkbox';
import { Orientation } from '@react-types/shared';
import { ReactRef } from '@heroui/react-utils';
import { CheckboxGroupState } from '@react-stately/checkbox';
import { CheckboxProps } from './checkbox.js';
import './use-checkbox.js';
interface Props extends HTMLHeroUIProps<"div"> {
/**
* Ref to the DOM node.
*/
ref?: ReactRef<HTMLDivElement | null>;
/**
* The axis the checkbox group items should align with.
* @default "vertical"
*/
orientation?: Orientation;
/**
* 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
* <CheckboxGroup classNames={{
* base:"base-classes",
* label: "label-classes",
* wrapper: "wrapper-classes", // checkboxes wrapper
* }} >
* // checkboxes
* </CheckboxGroup>
* ```
*/
classNames?: SlotsToClasses<CheckboxGroupSlots>;
/**
* React aria onChange event.
*/
onValueChange?: AriaCheckboxGroupProps["onChange"];
}
type UseCheckboxGroupProps = Omit<Props, "onChange"> & AriaCheckboxGroupProps & Partial<Pick<CheckboxProps, "color" | "size" | "radius" | "lineThrough" | "isDisabled" | "disableAnimation">>;
type ContextType = {
groupState: CheckboxGroupState;
color?: CheckboxProps["color"];
size?: CheckboxProps["size"];
radius?: CheckboxProps["radius"];
isInvalid?: UseCheckboxGroupProps["isInvalid"];
lineThrough?: CheckboxProps["lineThrough"];
isDisabled?: CheckboxProps["isDisabled"];
disableAnimation?: CheckboxProps["disableAnimation"];
validationBehavior?: CheckboxProps["validationBehavior"];
};
declare function useCheckboxGroup(props: UseCheckboxGroupProps): {
Component: _heroui_system.As<any>;
children: react.ReactNode;
label: react.ReactNode;
context: ContextType;
description: react.ReactNode;
isInvalid: boolean;
errorMessage: react.ReactNode;
getGroupProps: PropGetter<Record<string, unknown>, _heroui_system.DOMAttributes<_heroui_system.DOMElement>>;
getLabelProps: PropGetter<Record<string, unknown>, _heroui_system.DOMAttributes<_heroui_system.DOMElement>>;
getWrapperProps: PropGetter<Record<string, unknown>, _heroui_system.DOMAttributes<_heroui_system.DOMElement>>;
getDescriptionProps: PropGetter<Record<string, unknown>, _heroui_system.DOMAttributes<_heroui_system.DOMElement>>;
getErrorMessageProps: PropGetter<Record<string, unknown>, _heroui_system.DOMAttributes<_heroui_system.DOMElement>>;
};
type UseCheckboxGroupReturn = ReturnType<typeof useCheckboxGroup>;
export { ContextType, UseCheckboxGroupProps, UseCheckboxGroupReturn, useCheckboxGroup };