The objective of a component diagram is not the same as a class diagram. It is also not an alternative to package diagrams. The components focus on the stand-alone and replaceable components and how they can be assembled to create more complex systems.
1) The ball / socket representation concerns the interfaces supplied / required. Therefore
FooImpl would be a component that provides the
Foo interface (ball), while
Consumer would require the Foo interface (socket).
Foo itself is not a component: the interface is useless without implementation, so it is not autonomous. The interface is also not replaceable: if you replace it with another interface, it no longer fulfills the expected contract. It is therefore not necessary to have a hypothetical
2) The second part of your question seems to be related to the implementation technology. In UML, an interface is not included in a component. It is either supplied / produced or consumed / required by the component.
All the classes and interfaces required to create a component can be grouped into a package. A package diagram could better show the interdependence between the "components" of the language. The packages concern the grouping of associated modeling elements and their dependencies.
If you have another component that uses in one way or another an inter