import React from 'react';
import type { SharedProps } from '@coinbase/cds-common/types';
import { type BoxBaseProps, type BoxProps } from '../layout';
export type ControlGroupOption
= Omit
;
export type ControlGroupBaseProps<
ControlValue extends string = string,
ControlComponentProps extends {
value?: ControlValue;
} = {
value?: ControlValue;
},
> = Omit &
SharedProps & {
/** The control component to render for each option. */
ControlComponent: React.ComponentType;
/** Control options for the group. */
options: (ControlGroupOption & {
value: ControlValue;
})[];
/** Set a label for the group. */
label?: React.ReactNode;
/** Current selected value(s). Use a string for single-select (e.g., RadioGroup) and an array of strings for multi-select (e.g., CheckboxGroup). */
value: ControlValue | ControlValue[];
/** Handle change events. */
onChange?: (e: React.ChangeEvent) => void;
/** The role for the group. Use 'radiogroup' for radio buttons, 'group' for other controls. */
role?: 'group' | 'radiogroup';
/** The direction of the group. */
direction?: 'horizontal' | 'vertical';
/** The name of the group. */
name?: string;
};
export type ControlGroupProps<
ControlValue extends string,
ControlComponentProps extends {
value?: ControlValue;
},
> = ControlGroupBaseProps &
Omit, 'children' | 'onChange' | 'as'>;
declare const ControlGroupWithRef: <
ControlValue extends string,
ControlComponentProps extends {
value?: ControlValue;
},
>(
props: ControlGroupProps & {
ref?: React.Ref;
},
) => React.ReactElement;
export declare const ControlGroup: typeof ControlGroupWithRef &
React.MemoExoticComponent;
export {};
//# sourceMappingURL=ControlGroup.d.ts.map