UNPKG

@carbon/react

Version:

React components for the Carbon Design System

41 lines (35 loc) 1.06 kB
/** * 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. */ 'use strict'; 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 Form({ className, children, ...other }) { const prefix = usePrefix.usePrefix(); const classNames = cx(`${prefix}--form`, className); return /*#__PURE__*/React.createElement("form", _rollupPluginBabelHelpers.extends({ className: classNames }, other), children); } Form.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 = Form;