/** * Copyright 2019, SumUp Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { type FieldsetHTMLAttributes, type InputHTMLAttributes, type Ref } from 'react'; import { type RadioButtonProps } from '../RadioButton/index.js'; type Option = Omit & { /** * A clear and concise description of the option's purpose. */ label: string; /** * Further details about the option's purpose. */ description?: string; }; export interface RadioButtonGroupProps extends Omit, 'onChange'> { /** * A collection of available options. Each option must have at least a value * and a label. */ options: Option[]; /** * A callback that is called when any of the inputs change their values. * Passed on to the RadioButtons. */ onChange?: RadioButtonProps['onChange']; /** * A visually hidden description of the selector group for screen readers. */ label: string; /** * Label to indicate that the input is optional. Only displayed when the * `required` prop is falsy. */ optionalLabel?: string; /** * The value of the currently checked RadioButton. */ value?: RadioButtonProps['value']; /** * The value of the currently checked RadioButton. */ defaultValue?: RadioButtonProps['value']; /** * The ref to the HTML DOM element */ ref?: Ref; /** * An information, warning or error message, displayed below the input. */ validationHint?: string; /** * Triggers error message below the radio buttons. */ invalid?: boolean; /** * Triggers warning message below the radio buttons. */ hasWarning?: boolean; /** * Triggers valid message below the radio buttons. */ showValid?: boolean; /** * Makes the input group required. */ required?: InputHTMLAttributes['required']; /** * Visually hide the label. This should only be used in rare cases and only * if the purpose of the field can be inferred from other context. */ hideLabel?: boolean; } /** * A group of RadioButtons. */ export declare const RadioButtonGroup: import("react").ForwardRefExoticComponent & import("react").RefAttributes>; export {};