import { __assign } from '../../node_modules/tslib/tslib.es6.js';
import React from 'react';
import { useRadioGroup, VStack, Divider } from '@chakra-ui/react';
import { RadioListItem } from './RadioListItem.js';

var RadioList = function (_a) {
    var name = _a.name, defaultValue = _a.defaultValue, options = _a.options, onChange = _a.onChange;
    var _b = useRadioGroup({
        name: name,
        defaultValue: defaultValue,
        onChange: onChange,
    }), getRootProps = _b.getRootProps, getRadioProps = _b.getRadioProps;
    var group = getRootProps();
    return (React.createElement(VStack, __assign({}, group, { spacing: 0, divider: React.createElement(Divider, { key: "divider" }) }), options.map(function (option) {
        var radio = getRadioProps({ value: option.key });
        return (React.createElement(RadioListItem, __assign({ key: option.key }, radio), option));
    })));
};

export { RadioList as default };
//# sourceMappingURL=RadioList.js.map
