import React, { forwardRef } from "react"; import { BodyShort } from "../../typography"; import { omit, useId } from "../../utils-external"; import { cl } from "../../utils/helpers"; import { RadioInput } from "./radio-input/RadioInput"; import { RadioProps } from "./types"; import { useRadio } from "./useRadio"; export const Radio = forwardRef( (props: RadioProps, forwardedRef) => { const { inputProps, size, hasError, readOnly } = useRadio(props); const descriptionId = useId(); const { className, description, children } = props; return (
{children} {description && ( {description} )}
); }, ); export default Radio;