@lunit/oui
Version:
Lunit Oncology UI components
10 lines (9 loc) • 1.05 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Typography } from '@mui/material';
import clsx from 'clsx';
import { forwardRef } from 'react';
import { Container, StyledRadio, UncheckedIcon, CheckedIcon } from './Radio.styled';
const Radio = forwardRef(({ value, name, checked, defaultChecked, disabled, required, onChange, onChangeCapture, inputProps, inputRef, label, ...rootProps }, ref) => {
return (_jsxs(Container, { ...rootProps, className: clsx('radio', rootProps.className), component: label != null ? 'label' : 'span', ref: ref, children: [_jsx(StyledRadio, { disableRipple: true, icon: _jsx(UncheckedIcon, {}), checkedIcon: _jsx(CheckedIcon, {}), value: value, name: name, checked: checked, defaultChecked: defaultChecked, disabled: disabled, required: required, onChange: onChange, onChangeCapture: onChangeCapture, inputProps: inputProps, inputRef: inputRef }), label && (_jsx(Typography, { variant: "body_m1", sx: { display: 'flex', alignItems: 'center' }, children: label }))] }));
});
export default Radio;