@carbon/react
Version:
React components for the Carbon Design System
47 lines (39 loc) • 1.46 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 usePrefix = require('../../internal/usePrefix.js');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
var cx__default = /*#__PURE__*/_interopDefaultLegacy(cx);
function FormItem({
className,
children,
...rest
}) {
const prefix = usePrefix.usePrefix();
const classNames = cx__default["default"](`${prefix}--form-item`, className);
return /*#__PURE__*/React__default["default"].createElement("div", _rollupPluginBabelHelpers["extends"]({
className: classNames
}, rest), children);
}
FormItem.propTypes = {
/**
* Provide content to be rendered in the form item
*/
children: PropTypes__default["default"].node,
/**
* Provide a custom className to be applied to the containing node
*/
className: PropTypes__default["default"].string
};
exports["default"] = FormItem;