UNPKG

@payfit/unity-components

Version:

38 lines (37 loc) 1.28 kB
import { CheckboxGroup as e } from "../checkbox-group/CheckboxGroup.js"; import { FormField as t } from "../form-field/FormField.js"; import { FormControl as n } from "../form-field/parts/FormControl.js"; import { FormFeedbackText as r } from "../form-field/parts/FormFeedbackText.js"; import { forwardRef as i } from "react"; import { jsx as a, jsxs as o } from "react/jsx-runtime"; import { useFormContext as s } from "react-hook-form"; //#region src/components/checkbox-group-field/CheckboxGroupField.tsx function c({ name: i, label: c, defaultValue: l, helperText: u, contextualLink: d, isRequired: f, isInvalid: p, isLoading: m, isDisabled: h, isReadOnly: g, requiredVariant: _, children: v, ...y }, b) { let { control: x, watch: S } = s(); return /* @__PURE__ */ o(t, { control: x, name: i, isRequired: f, isInvalid: p, isLoading: m, isDisabled: h, isReadOnly: g, children: [/* @__PURE__ */ a(n, { children: /* @__PURE__ */ a(e, { ref: b, label: c, defaultValue: l, value: S(i), helperText: u, feedbackText: /* @__PURE__ */ a(r, {}), requiredVariant: _, ...y, children: v }) }), d] }); } var l = i(function(e, t) { return c(e, t); }); l.displayName = "CheckboxGroupField"; //#endregion export { l as CheckboxGroupField };