UNPKG

@mskcc/carbon-react

Version:

Carbon react components for the MSKCC DSM

73 lines (72 loc) 2.37 kB
/** * MSKCC DSM 2021, 2023 */ import PropTypes from 'prop-types'; import React from 'react'; import { ReactAttr } from '../../types/common'; export interface FormGroupProps extends ReactAttr<HTMLFieldSetElement> { /** * Provide the children form elements to be rendered inside of the <fieldset> */ children: React.ReactNode; /** * Provide a custom className to be applied to the containing <fieldset> node */ className?: string; /** * Specify whether the <FormGroup> is invalid */ invalid?: boolean; /** * Provide id for the fieldset <legend> which corresponds to the fieldset * `aria-labelledby` */ legendId?: string; /** * Provide the text to be rendered inside of the fieldset <legend> */ legendText?: React.ReactNode; /** * Specify whether the message should be displayed in the <FormGroup> */ message?: boolean; /** * Provide the text for the message in the <FormGroup> */ messageText?: string; } declare const FormGroup: { ({ legendId, legendText, invalid, children, className, message, messageText, ...rest }: FormGroupProps): JSX.Element; propTypes: { /** * Provide the children form elements to be rendered inside of the <fieldset> */ children: PropTypes.Requireable<PropTypes.ReactNodeLike>; /** * Provide a custom className to be applied to the containing <fieldset> node */ className: PropTypes.Requireable<string>; /** * Specify whether the <FormGroup> is invalid */ invalid: PropTypes.Requireable<boolean>; /** * Provide id for the fieldset <legend> which corresponds to the fieldset * `aria-labelledby` */ legendId: PropTypes.Requireable<PropTypes.ReactNodeLike>; /** * Provide the text to be rendered inside of the fieldset <legend> */ legendText: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>; /** * Specify whether the message should be displayed in the <FormGroup> */ message: PropTypes.Requireable<boolean>; /** * Provide the text for the message in the <FormGroup> */ messageText: PropTypes.Requireable<string>; }; }; export default FormGroup;