import type { FC, PropsWithChildren } from "react"; import type { ToggleButtonBaseProps } from "../../Actions/ToggleButton/ToggleButtonBase"; type ToggleGroupSharedProps = { /** * The class name of the `ToggleGroup`. */ className?: string; /** * Defines whether the `ToggleGroup` is disabled, * preventing the user from interacting with the toggle group and all its items. */ disabled?: boolean; }; type ToggleGroupSingleProps = { /** * Defines whether a single or multiple items can be pressed at a time. */ type: "single"; /** * Defines the controlled value of the pressed item. * Must be used in conjunction with `onChange`. */ value?: T; /** * Defines the value of the item to show as pressed when initially rendered. * Use when you do not need to control the state of the items. */ defaultValue?: T; /** * Defines the event handler called when the pressed state of an item changes. */ onChange?: (value: T) => void; }; type ToggleGroupMultipleProps = { /** * Defines whether a single or multiple items can be pressed at a time. */ type: "multiple"; /** * Defines the controlled value of the pressed items. * Must be used in conjunction with `onChange`. */ value?: T[]; /** * Defines the values of the items to show as pressed when initially rendered. * Use when you do not need to control the state of the items. */ defaultValue?: T[]; /** * Defines the event handler called when the pressed state of an item changes. */ onChange?: (value: T[]) => void; }; export type ToggleGroupProps = ToggleGroupSharedProps & (ToggleGroupSingleProps | ToggleGroupMultipleProps); export type ToggleGroupComponent = FC>> & { Item: FC>>; }; export type ToggleGroupItemProps = PropsWithChildren; /** * The `ToggleGroup` component is a toggle group that allows users to select one or more options. * * See the [ToggleGroup documentation page](https://satellite.algolia.com/8261d6576/p/523b02-toggle-group) for more information. */ export declare const ToggleGroup: ToggleGroupComponent; export {};