import PropTypes from "prop-types"; import React from "react"; import HelpPopover from "../HelpPopover"; import Section from "./Section"; import Item from "./Item"; import Row from "./Row"; import classNames from "classnames"; export interface FormProps { children: any; /** CSS class names. */ className?: string; /** Description for Form */ description?: string; /** Indicates whether to include a help popover */ helpIcon?: boolean; /** Text for popover */ popoverText?: string; /** Title for popover */ popoverTitle?: string; testSection?: string; /** Title for Form */ title?: string; } const Form = ({ // eslint-disable-line @typescript-eslint/explicit-function-return-type children, className, description, helpIcon, popoverText, popoverTitle, testSection, title, ...props }: FormProps) => { const formTitleClasses = classNames({ "push--bottom": description, "push-double--bottom": !description, }); return (
); }; Form.Section = Section; Form.Item = Item; Form.Row = Row; Form.propTypes = { children: PropTypes.node.isRequired, /** CSS class names. */ className: PropTypes.string, /** Description for Form */ description: PropTypes.node, /** Indicates whether to include a help popover */ helpIcon: PropTypes.bool, /** Text for popover */ popoverText: PropTypes.string, /** Title for popover */ popoverTitle: PropTypes.string, testSection: PropTypes.string, /** Title for Form */ title: PropTypes.string, }; export default Form;