import { __assign } from "tslib";
import { jsx as _jsx } from "react/jsx-runtime";
import cx from 'classnames';
import { useContext, useMemo } from 'react';
import GroupContext from './GroupContext';
import { DisabledContext } from '../disabled';
export function RadioGroup(props) {
    var disabledCtx = useContext(DisabledContext);
    var value = props.value, _a = props.disabled, disabled = _a === void 0 ? disabledCtx.value : _a, _b = props.readOnly, readOnly = _b === void 0 ? false : _b, _c = props.isValueEqual, isValueEqual = _c === void 0 ? Object.is : _c, className = props.className, style = props.style, children = props.children, onChange = props.onChange;
    var ctx = useMemo(function () { return ({
        value: value,
        disabled: disabled,
        readOnly: readOnly,
        isValueEqual: isValueEqual,
        onRadioChange: onChange,
    }); }, [value, disabled, readOnly, isValueEqual, onChange]);
    return (_jsx(GroupContext.Provider, __assign({ value: ctx }, { children: _jsx("div", __assign({ className: cx('zent-radio-group', className), style: style, "data-zv": 'v10.0.11' }, { children: children }), void 0) }), void 0));
}
export default RadioGroup;
