UNPKG

@payfit/unity-components

Version:

41 lines (40 loc) • 1.28 kB
import { FormField as e } from "../form-field/FormField.js"; import { FormFeedbackText as t } from "../form-field/parts/FormFeedbackText.js"; import { FormHelperText as n } from "../form-field/parts/FormHelperText.js"; import { FormLabel as r } from "../form-field/parts/FormLabel.js"; import { Input as i } from "../input/Input.js"; import { TextArea as a } from "../text-area/TextArea.js"; import { forwardRef as o } from "react"; import { jsx as s, jsxs as c } from "react/jsx-runtime"; //#region src/modules/tanstack-form/components/text-field/TextField.tsx function l({ label: o, helperText: l, contextualLink: u, multiline: d, isRequired: f, isLoading: p, isDisabled: m, isReadOnly: h, requiredVariant: g, ..._ }, v) { let y = { isLoading: p, isDisabled: m, isReadOnly: h }, { onClearButtonPress: b } = d ? {} : _; return /* @__PURE__ */ c(e, { children: [ /* @__PURE__ */ s(r, { requiredVariant: g, isRequired: f, children: o }), l && /* @__PURE__ */ s(n, { children: l }), d ? /* @__PURE__ */ s(a, { ref: v, ...y, ..._ }) : /* @__PURE__ */ s(i, { ref: v, onClearButtonPress: b, ...y, ..._ }), /* @__PURE__ */ s(t, {}), u ] }); } var u = o(l); u.displayName = "TextField"; //#endregion export { u as TextField };