UNPKG

@talend/react-forms

Version:

React forms library based on json schema form.

38 lines 1.04 kB
import PropTypes from 'prop-types'; import { Form, StackVertical } from '@talend/design-system'; import { getLabelProps } from '../../../utils/labels'; import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime"; function FieldTemplate({ id, label, labelProps, children }) { return /*#__PURE__*/_jsxs(StackVertical, { gap: "XXS", align: "stretch", justify: "start", height: "100%", noShrink: true, children: [/*#__PURE__*/_jsx(Form.Label, { htmlFor: id, ...getLabelProps(label, labelProps) }), /*#__PURE__*/_jsx("div", { id: id, children: children || /*#__PURE__*/_jsx(_Fragment, { children: "\xA0" }) })] }); } if (process.env.NODE_ENV !== 'production') { FieldTemplate.propTypes = { children: PropTypes.node, id: PropTypes.string, label: PropTypes.string, labelProps: PropTypes.object }; } FieldTemplate.displayName = 'FieldTemplate'; export default FieldTemplate; //# sourceMappingURL=TextMode.component.js.map