'use client'; import * as React from 'react'; import { useMergeProps } from '../../../hooks/useMergeProps'; import { warnOnce } from '../../../lib/warnOnce'; import type { HasDataAttribute, HasRootRef } from '../../../types'; import { AdaptiveIconRenderer } from '../../AdaptiveIconRenderer/AdaptiveIconRenderer'; import { RootComponent } from '../../RootComponent/RootComponent'; import { VisuallyHidden } from '../../VisuallyHidden/VisuallyHidden'; import styles from './RadioInput.module.css'; const warn = warnOnce('Radio.Input'); function RadioIcon24(props: React.ComponentProps<'svg'>) { return ( ); } function RadioIcon20(props: React.ComponentProps<'svg'>) { return ( ); } function RadioIcon() { return (
); } export interface RadioInputProps extends Omit, 'type'>, HasRootRef { /** * Свойства, которые можно прокинуть внутрь компонента: * - `root`: свойства для прокидывания в корень компонента; * - `input`: свойства для прокидывания в скрытый `input`. */ slotProps?: { root?: Omit, 'children'> & HasRootRef & HasDataAttribute; input?: Omit, 'type'> & HasRootRef & HasDataAttribute; }; /** * @deprecated Since 7.9.0. Вместо этого используйте `slotProps={ input: { getRootRef: ... } }`. */ getRef?: React.Ref; } export function RadioInput({ className, style, getRootRef, getRef, slotProps, ...restProps }: RadioInputProps) { if (process.env.NODE_ENV === 'development' && getRef) { warn('Свойство `getRef` устаревшее, используйте `slotProps={ input: { getRootRef: ... } }`'); } const rootRest = useMergeProps({ className, style, getRootRef }, slotProps?.root); const inputProps = useMergeProps({ getRootRef: getRef, ...restProps }, slotProps?.input); return ( ); }