UNPKG

@drivy/cobalt

Version:

Opinionated design system for Drivy's projects.

18 lines (15 loc) 611 B
import React from 'react'; import { withFieldLabelAndHint } from './field.js'; const ComposedFormField = ({ id, children }) => { return (React.createElement("div", { className: "cobalt-ComposedFormField" }, React.Children.toArray(children).map((child, index) => { return index === 0 ? React.cloneElement(child, { id, }) : child; }))); }; const wrappedComponent = withFieldLabelAndHint(ComposedFormField); wrappedComponent.displayName = "ComposedField"; export { wrappedComponent as ComposedField }; //# sourceMappingURL=ComposedField.js.map