@payfit/unity-components
Version:
27 lines (26 loc) • 1.13 kB
JavaScript
import { FileUploadTrigger as e } from "../../../../core/components/file-upload-trigger/FileUploadTrigger.js";
import { useFieldContext as t } from "../../hooks/tanstack-form-context.js";
import { useFieldA11yContext as n } from "../form-field/TanstackFormField.context.js";
import { cloneElement as r, forwardRef as i } from "react";
import { jsx as a } from "react/jsx-runtime";
//#region src/modules/tanstack-form/components/tanstack-file-upload-trigger/TanstackFileUploadTrigger.tsx
var o = i(({ children: i, isDisabled: o, ...s }, c) => {
let l = t(), u = n(), d = [u.helperTextId, u.feedbackTextId].filter(Boolean).join(" "), f = i;
return /* @__PURE__ */ a(e, {
...s,
ref: c,
id: u.inputId,
name: l.name,
onSelect: (e) => {
l.handleChange(e ? Array.from(e) : []), l.handleBlur();
},
children: r(f, {
"aria-labelledby": u.labelId || f.props["aria-labelledby"],
"aria-describedby": [f.props["aria-describedby"], d].filter(Boolean).join(" ") || void 0,
isDisabled: o || f.props.isDisabled
})
});
});
o.displayName = "FileUploadTriggerInput";
//#endregion
export { o as FileUploadTriggerInput };