UNPKG

@payfit/unity-components

Version:

43 lines (42 loc) 1.43 kB
import { SelectableButtonGroup as e } from "../selectable-button-group/SelectableButtonGroup.js"; import { FormHelperText as t } from "../form-field/parts/FormHelperText.js"; import { FormField as n } from "../form-field/FormField.js"; import { FormControl as r } from "../form-field/parts/FormControl.js"; import { FormFeedbackText as i } from "../form-field/parts/FormFeedbackText.js"; import { FormLabel as a } from "../form-field/parts/FormLabel.js"; import { forwardRef as o } from "react"; import { jsx as s, jsxs as c } from "react/jsx-runtime"; import { useFormContext as l } from "react-hook-form"; //#region src/components/selectable-button-group-field/SelectableButtonGroupField.tsx function u({ name: o, label: u, helperText: d, contextualLink: f, isDisabled: p, requiredVariant: m, children: h, ...g }, _) { let { control: v, watch: y } = l(), b = y(o); return /* @__PURE__ */ c(n, { control: v, name: o, ref: _, children: [ /* @__PURE__ */ s(a, { requiredVariant: m, children: u }), d && /* @__PURE__ */ s(t, { children: d }), /* @__PURE__ */ s(r, { className: "uy:my-50", children: /* @__PURE__ */ s(e, { value: b, isDisabled: p, ...g, children: h }) }), /* @__PURE__ */ s(i, {}), f ] }); } var d = o(function(e, t) { return u(e, t); }); d.displayName = "SelectableButtonGroupField"; //#endregion export { d as SelectableButtonGroupField };