@shopify/polaris
Version:
Shopify’s product component library
28 lines (23 loc) • 751 B
JavaScript
import React$1, { memo, Children } from 'react';
import { isElementOfType, wrapWithComponent } from '../../utilities/components.js';
import styles from './FormLayout.scss.js';
import { Item as Item$1 } from './components/Item/Item.js';
import { Group as Group$1 } from './components/Group/Group.js';
var FormLayout = /*#__PURE__*/memo(function FormLayout({
children
}) {
return /*#__PURE__*/React$1.createElement("div", {
className: styles.FormLayout
}, Children.map(children, wrapChildren));
});
FormLayout.Group = Group$1;
function wrapChildren(child, index) {
if (isElementOfType(child, Group$1)) {
return child;
}
var props = {
key: index
};
return wrapWithComponent(child, Item$1, props);
}
export { FormLayout };