import * as React from "react"; import type { StyleType } from "@khanacademy/wonder-blocks-core"; import Choice from "./choice"; type CheckboxGroupProps = { /** * Children should be Choice components. */ children: Array> | false | null | undefined>; /** * Group name for this checkbox or radio group. Should be unique for all * such groups displayed on a page. */ groupName: string; /** * Optional label for the group. This label is optional to allow for * greater flexibility in implementing checkbox and radio groups. */ label?: React.ReactNode; /** * Optional description for the group. */ description?: React.ReactNode; /** * Optional error message. If supplied, the group will be displayed in an * error state, along with this error message. If no error state is desired, * simply do not supply this prop, or pass along null. */ errorMessage?: string | null | undefined; /** * Custom styling for this group of checkboxes. */ style?: StyleType; /** * Callback for when selection of the group has changed. Passes the newly * selected values. */ onChange: (selectedValues: Array) => unknown; /** * An array of the values of the selected values in this checkbox group. */ selectedValues: Array; /** * Test ID used for e2e testing. */ testId?: string; }; /** * A checkbox group allows multiple selection. This component auto-populates * many props for its children Choice components. The Choice component is * exposed for the user to apply custom styles or to indicate which choices are * disabled. * * ### Usage * * ```jsx * import {Choice, CheckboxGroup} from "@khanacademy/wonder-blocks-form"; * * const [selectedValues, setSelectedValues] = React.useState([]); * * * // Add as many choices as necessary * * * * ``` */ declare const CheckboxGroup: React.ForwardRefExoticComponent>; export default CheckboxGroup;