import React__default from 'react';
import { useUniqueId } from '../../../utils/uniqueId.mjs';
import { RowItemCore } from './RowItem.mjs';
import FormGroup from '../../../../../../node_modules/@mui/material/FormGroup/FormGroup.mjs';

const RadioGroupCore = ({ id, items, onChange, readOnly, value, formGroupSx, RadioComponent: Radio })=>{
    const radioGroupId = useUniqueId(id);
    const onClick = (value)=>{
        onChange?.(value);
    };
    return /*#__PURE__*/ React__default.createElement(RowItemCore, {
        fullWidth: true
    }, /*#__PURE__*/ React__default.createElement(FormGroup, {
        sx: formGroupSx,
        id: radioGroupId
    }, items.map((item)=>/*#__PURE__*/ React__default.createElement(Radio, {
            ...item,
            checked: item.value === value,
            disabled: item.disabled || readOnly,
            key: item.value,
            onClick: onClick
        }))));
};

export { RadioGroupCore };
//# sourceMappingURL=RadioGroup.mjs.map
