They seem to have self-replicating mines, for god-sakes... how about replicating phaser arrays, plating, life-support systems, etc.
The question assumes facts not in evidence; we don't know that replicator technology isn't used to effect repairs, we just haven't seen it.
But there is a philosophical answer to your question: Repairs require judgment and coordination. We've seen automated systems reroute power and communications, and if a big hole gets shot into the side of the ship, the computer erects a force-field. But if you "repair" a power system that someone else is working on, you might electrocute them. If the captain wants to play dead and lure the enemy in, he can't have the ship growing new parts and turning the lights back on to spoil the illusion. The computers on Enterprise are very capable indeed and probably could conduct deep space missions without a crew, but Starfleet philosophy seems to be to severely limit machine autonomy. Starfleet officers seem to have a deep distrust of computer judgment beyond a second or two in the future and prefer to keep people in the decision loop as much as possible. Having Borg-like self-healing ships would be a step too far for the civilization the Federation has chosen to have.
It is being done. In one episode of Star Trek: Enterprise, there is a fully automated repair station that can replicate ship's parts and then teleport them in place. It probably cannot repair warp core though.
Replicators may be able to create simple components (such as bulkheads and the like), but it has been consistently demonstrated that that they have limits and that there are many substances that they cannot create. For example, Latinum is so treasured by the Ferengi because it cannot be replicated. Considering how insanely complex warp cores and similar technologies are, it seems reasonable that at least one of the following cannot be replicated:
...the list goes on.
Also we have to take into consideration the fact that replicators cannot create substances that are poisonous or incredibly dangerous-- this definitely rules out antimatter. The most important reason would probably be that ultimately replicators are too accident-prone to entrust to such sensitive equipment, at least the pieces of it that they can create.
Good thing that was coffee and not plasma coolant!