import * as RMWC from '@rmwc/types' ; import React from 'react' ; import { RadioProps , RadioHTMLProps } from '.' ; import { useToggleFoundation } from '@rmwc/toggleable' ; import { useFoundation } from '@rmwc/base' ; import { MDCRadioFoundation } from '@material/radio' ; export const useRadioFoundation = ( props ) => { const { renderToggle , toggleRootProps , id } = useToggleFoundation < MDCRadioFoundation > ( props ) ; const { foundation , ... elements } = useFoundation ( { props , elements : { rootEl : true } , foundation : ( { rootEl } ) => { return new MDCRadioFoundation ( { addClass : ( className ) => rootEl . addClass ( className ) , removeClass : ( className ) => rootEl . removeClass ( className ) } ) ; } } ) ; return { foundation , renderToggle , toggleRootProps , id , ... elements } ; } ;