import React, { forwardRef } from "react";
import { Slot } from "../../../utils/components/slot/Slot.js";
import { useFileUpload } from "../hooks/useFileUpload.js";
const FileUploadTrigger = forwardRef(({ children, multiple = true, accept, onSelect, validator, maxSizeInBytes, }, ref) => {
    const { onChange, inputRef, mergedRef } = useFileUpload({
        ref,
        onSelect,
        validator,
        accept,
        maxSizeInBytes,
        disabled: false,
    });
    return (React.createElement(React.Fragment, null,
        React.createElement(Slot, { onClick: () => { var _a; return (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.click(); } }, children),
        React.createElement("input", { ref: mergedRef, type: "file", style: { display: "none" }, multiple: multiple, accept: accept, onChange: onChange })));
});
export default FileUploadTrigger;
export { FileUploadTrigger };
//# sourceMappingURL=FileUploadTrigger.js.map