@payfit/unity-components
Version:
38 lines (37 loc) • 1.47 kB
JavaScript
import { RadioButtonGroup as e } from "../radio-button-group/RadioButtonGroup.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/radio-button-group-field/RadioButtonGroupField.tsx
var u = o(({ children: o, label: u, isReadOnly: d, isDisabled: f, isInvalid: p, isRequired: m, name: h, requiredVariant: g, feedbackText: _, helperText: v }, y) => {
let { control: b } = l();
return /* @__PURE__ */ c(n, {
control: b,
name: h,
isRequired: m,
isInvalid: p,
isDisabled: f,
isReadOnly: d,
ref: y,
className: "uy:gap-150",
children: [/* @__PURE__ */ c("div", {
className: "uy:flex uy:flex-col uy:gap-50",
children: [
/* @__PURE__ */ s(a, {
requiredVariant: g,
children: u
}),
/* @__PURE__ */ s(t, { children: v }),
/* @__PURE__ */ s(i, { children: _ })
]
}), /* @__PURE__ */ s(r, { children: /* @__PURE__ */ s(e, { children: o }) })]
});
});
u.displayName = "RadioButtonGroupField";
//#endregion
export { u as RadioButtonGroupField };