UNPKG

@payfit/unity-components

Version:

30 lines (29 loc) 1.13 kB
import { SelectableCardRadioGroup as e } from "./SelectableCardRadioGroup.js"; import { useFieldContext as t } from "../../../hooks/tanstack-form-context.js"; import { useFieldA11yContext as n } from "../../form-field/TanstackFormField.context.js"; import { forwardRef as r } from "react"; import { jsx as i } from "react/jsx-runtime"; //#region src/components/selectable-card/selectable-card-radio-group/TanstackSelectableCardRadioGroup.tsx var a = r(({ onBlur: r, onChange: a, children: o, ...s }, c) => { let l = t(), u = n(), d = l.state.meta.isTouched && !l.state.meta.isValid, f = [u.helperTextId, u.feedbackTextId].filter(Boolean).join(" "); return /* @__PURE__ */ i(e, { ...s, ref: c, id: u.inputId, value: l.state.value || void 0, onChange: (e) => { l.handleChange(e), a?.(e); }, onBlur: (e) => { l.handleBlur(), r?.(e); }, isInvalid: d, "aria-labelledby": u.labelId, "aria-describedby": f.length > 0 ? f : void 0, "aria-details": u.contextualLinkId, children: o }); }); a.displayName = "TanstackSelectableCardRadioGroup"; //#endregion export { a as TanstackSelectableCardRadioGroup };