@drivy/cobalt
Version:
Opinionated design system for Drivy's projects.
17 lines (16 loc) • 719 B
JavaScript
import { jsx } from "react/jsx-runtime";
import react from "react";
import { withFieldLabelAndHint } from "./field.js";
const ComposedFormField = ({ id, children })=>/*#__PURE__*/ jsx("div", {
className: "cobalt-ComposedFormField",
children: react.Children.toArray(children).map((child, index)=>{
if (0 === index && /*#__PURE__*/ react.isValidElement(child)) return /*#__PURE__*/ react.cloneElement(child, {
id
});
return child;
})
});
const wrappedComponent = withFieldLabelAndHint(ComposedFormField);
wrappedComponent.displayName = "ComposedField";
export { wrappedComponent as ComposedField };
//# sourceMappingURL=ComposedField.js.map