UNPKG

@parkassist/pa-ui-library

Version:
54 lines 1.38 kB
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime"; import React from 'react'; import Palette from "../../constants/Palette"; import Radio from '@mui/material/Radio'; import { FontStyles } from "../../index"; import FormControlLabel from '@mui/material/FormControlLabel'; const CustomRadio = ({ onChange, value, checked, name, label, size = 'small', disabled = false, styles = {}, onClick }) => { const color = Palette.LIGHT_BLACK; return _jsx(_Fragment, { children: _jsx(FormControlLabel, { value: value, disabled: disabled, checked: checked, onChange: onChange, onClick: onClick, label: label, control: _jsx(Radio, { size: size, name: name, disableRipple: true, sx: Object.assign({ padding: '8px', color, '&.Mui-checked.MuiRadio-root, &.Mui-checked.MuiRadio-root.MuiRadio-colorPrimary': { color }, '&.Mui-disabled.MuiRadio-root, &.Mui-disabled.Mui-checked.MuiRadio-root ': { color: 'rgba(0, 0, 0, 0.26)' } }, styles) }), sx: { margin: 0, '& .MuiTypography-root': { font: FontStyles.INPUT_FONT }, '& .MuiFormControlLabel-label': { color } } }) }); }; export default CustomRadio;