@nafr/echo-ui
Version:
A UI library born for WAA
20 lines (19 loc) • 823 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { forwardRef } from 'react';
import { cn } from '../../../lib/utils';
import { RadioGroupContextProvider } from './context';
import { useGroupStyle } from './styles';
import { SIZE, COLOR } from './constants';
export const RadioGroup = forwardRef((props, ref) => {
const { value, disabled = false, size = SIZE, color = COLOR, classNames, styles, onChange, ...restProps } = props;
const contextValue = {
value,
size,
color,
disabled,
classNames,
styles,
onChange,
};
return (_jsx(RadioGroupContextProvider, { value: contextValue, children: _jsx("div", { ...restProps, ref: ref, className: cn(useGroupStyle(), restProps.className), style: restProps.style, children: restProps.children }) }));
});