UNPKG

@open-formulieren/formio-builder

Version:

An opinionated Formio webform builder for Open Forms

17 lines (16 loc) 1.07 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const jsx_runtime_1 = require("react/jsx-runtime"); const clsx_1 = __importDefault(require("clsx")); const errors_1 = require("../../utils/errors"); const errors_2 = require("../../utils/errors"); const tooltip_1 = __importDefault(require("./tooltip")); const Fieldset = ({ field = '', label, tooltip = '', children }) => { const { errors } = (0, errors_1.useValidationErrors)(field); const className = (0, clsx_1.default)('field-group'); return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: className }, { children: (0, jsx_runtime_1.jsxs)("fieldset", { children: [label && ((0, jsx_runtime_1.jsxs)("legend", { children: [label, tooltip && ' ', (0, jsx_runtime_1.jsx)(tooltip_1.default, { text: tooltip })] })), children, (0, jsx_runtime_1.jsx)(errors_2.ErrorList, { errors: errors })] }) }))); }; exports.default = Fieldset;