@mskcc/carbon-react
Version:
Carbon react components for the MSKCC DSM
41 lines (37 loc) • 1.05 kB
JavaScript
/**
* MSKCC 2021, 2024
*/
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
import PropTypes from 'prop-types';
import React__default from 'react';
import cx from 'classnames';
import Form from '../Form/Form.js';
import { FormContext } from './FormContext.js';
import { usePrefix } from '../../internal/usePrefix.js';
const FluidForm = _ref => {
let {
className,
children,
...other
} = _ref;
const prefix = usePrefix();
const classNames = cx(`${prefix}--form--fluid`, className);
return /*#__PURE__*/React__default.createElement(FormContext.Provider, {
value: {
isFluid: true
}
}, /*#__PURE__*/React__default.createElement(Form, _extends({
className: classNames
}, other), children));
};
FluidForm.propTypes = {
/**
* Provide children to be rendered inside of the <form> element
*/
children: PropTypes.node,
/**
* Provide a custom className to be applied on the containing <form> node
*/
className: PropTypes.string
};
export { FluidForm as default };