@carbon/react
Version:
React components for the Carbon Design System
47 lines (41 loc) • 1.3 kB
JavaScript
/**
* Copyright IBM Corp. 2016, 2023
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
;
Object.defineProperty(exports, '__esModule', { value: true });
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
var PropTypes = require('prop-types');
var React = require('react');
var cx = require('classnames');
var Form = require('../Form/Form.js');
var FormContext = require('./FormContext.js');
var usePrefix = require('../../internal/usePrefix.js');
const FluidForm = ({
className,
children,
...other
}) => {
const prefix = usePrefix.usePrefix();
const classNames = cx(`${prefix}--form--fluid`, className);
return /*#__PURE__*/React.createElement(FormContext.FormContext.Provider, {
value: {
isFluid: true
}
}, /*#__PURE__*/React.createElement(Form.default, _rollupPluginBabelHelpers.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
};
exports.default = FluidForm;