react-lightning-design-system
Version:
Salesforce Lightning Design System components built with React
31 lines (29 loc) • 1.03 kB
JavaScript
import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["className", "type", "children"];
import React from 'react';
import classnames from 'classnames';
import { FormElement } from './FormElement';
/**
*
*/
/**
*
*/
export var Form = function Form(props) {
var className = props.className,
_props$type = props.type,
type = _props$type === void 0 ? 'stacked' : _props$type,
children = props.children,
rprops = _objectWithoutProperties(props, _excluded);
var formClassNames = classnames(className, "slds-form_".concat(type));
return /*#__PURE__*/React.createElement("div", _extends({
className: formClassNames
}, rprops), React.Children.map(children, function (child) {
if ( /*#__PURE__*/React.isValidElement(child) && !child.type.isFormElement) {
return /*#__PURE__*/React.createElement(FormElement, null, child);
}
return child;
}));
};
//# sourceMappingURL=Form.js.map