import { ChangeEvent } from 'react'; import { InputGroupProps } from '../shared/InputGroup/InputGroup'; import { InputCheckboxProps, InputCheckboxScale } from '../InputCheckbox/InputCheckbox'; type FilteredInputCheckboxProps = Readonly>; export type InputCheckboxGroupProps = InputGroupProps & { options: readonly FilteredInputCheckboxProps[]; onChange: (event: ChangeEvent) => void; selectedValues: readonly string[]; /** Controls the scale of all checkboxes in the group. Overridden per-item by a `scale` on the option itself. */ scale?: InputCheckboxScale; }; /** * - InputCheckboxGroup is a controlled component: You must provide an `onChange` handler to update `selectedValues`. * - `id` is required to associate the fieldset with the optional `message`. The `id` is also used to generate the checkbox inputs' shared `name` attribute. * - Use title case for the required `label` (e.g., "Dietary Restrictions", not "Dietary restrictions"). * * ## Hello, World! * ```jsx * import { useState } from 'react'; * import { InputCheckboxGroup } from '@companycam/slab-web'; * * const [selectedValues, setSelectedValues] = useState(["gf", "veg"]); * * const handleOnChange = (event: ChangeEvent) => { * if (event.target.checked) { * setSelectedValues([...selectedValues, event.target.value]); * } else { * setSelectedValues( * selectedValues.filter((value) => value !== event.target.value) * ); * } * }; * * return ( * * ); * ``` */ export declare function InputCheckboxGroup({ onChange, options, selectedValues, scale, ...props }: InputCheckboxGroupProps): import("react/jsx-runtime").JSX.Element; export default InputCheckboxGroup;