UNPKG

@rjsf/mui

Version:

Material UI 7 theme, fields and widgets for react-jsonschema-form

19 lines 976 B
import { jsx as _jsx } from "react/jsx-runtime"; import Typography from '@mui/material/Typography'; import { getUiOptions, } from '@rjsf/utils'; import { RichDescription } from '@rjsf/core'; import { computeSxProps, getMuiProps } from '../util.js'; /** The `DescriptionField` is the template to use to render the description of a field * * @param props - The `DescriptionFieldProps` for this component */ export default function DescriptionField(props) { const { id, description, registry, uiSchema } = props; const uiOptions = getUiOptions(uiSchema); const { rjsfSlotProps: { descTypography } = {} } = getMuiProps(uiOptions); if (description) { return (_jsx(Typography, { id: id, variant: 'subtitle2', ...descTypography, sx: computeSxProps({ mt: 0.625 }, descTypography), children: _jsx(RichDescription, { description: description, registry: registry, uiSchema: uiSchema }) })); } return null; } //# sourceMappingURL=DescriptionField.js.map