import React, { forwardRef } from "react";
import { toObjectValue } from "../../../utils/index.js";
import { StyledChoice } from "./Choice.styled.js";
import { ChoiceItem } from "./ChoiceItem.js";
const Choice = forwardRef(({ value, values, name, onChange, ...props }, ref) => {
    const opts = values.map(option => {
        const opt = toObjectValue(option);
        return (React.createElement(ChoiceItem, { key: opt.value, name: name, value: opt, onChange: onChange, active: value === opt.value }));
    });
    return (React.createElement(StyledChoice, { ...props, ref: ref }, opts));
});
Choice.displayName = "Choice";
Choice.toString = () => StyledChoice.toString();
const ChoiceItemSelector = ChoiceItem.toString();
export { Choice, ChoiceItemSelector };
//# sourceMappingURL=Choice.js.map