\documentclass[tikz]{standalone}
% C:\cygwin64\bin\convert.exe -density 600 name_components.pdf name_components.png
\usetikzlibrary{positioning,fit, matrix, decorations.pathreplacing}

\begin{document}

\begin{tikzpicture}
\begin{scope}[node distance=0.2em, 
 every node/.style={inner sep = 0, text height = 1.5ex, text depth = .25ex}]
\node             (a) {pkg};
\node[right=of a] (b) {sub};
\node[right=of b] (c) {mod};
\path (a) -- node{.} (b) -- node{.} (c);
\end{scope}
% \node [draw, inner sep = 0em, fit = (a) (b)] (A) {};
\node [inner sep = 0em, fit=(a)        ] (A) {};
\node [inner sep = 0em, fit=(a) (b)    ] (B) {};
\node [inner sep = 0em, fit=(a) (b) (c)] (C) {};
%
% Upper Annotations
%
\matrix [matrix of nodes, node distance = 0.5 em and 4 em, above right=of A] (U)
{
 Package\\
 Module \\
};
% \draw [decorate,decoration={brace, mirror, amplitude=3pt, raise=0.1em}] (a.south west) -- (a.south east) coordinate [black,midway,yshift=-0.4em] (LA) {};
\draw [decorate,decoration={brace, amplitude=3pt, raise=0.1em}] (a.north west) -- (b.north east) coordinate [black,midway,yshift=0.4em] (UA) {};
\draw [decorate,decoration={brace, amplitude=3pt, raise=0.1em}] (c.north west) -- (c.north east) coordinate [black,midway,yshift=0.4em] (UC) {};
% \draw (pA) |- (U-2-1);
\draw (UA) |- (U-1-1);
\draw (UC) |- (U-2-1);
%
% Lower Annotations
%
\matrix [matrix of nodes, node distance = 0.5 em and 4 em, below right=of A] (L)
{
 Submodule  \\
 Subpackage \\
%  Package    \\
};
% \draw [decorate,decoration={brace, mirror, amplitude=3pt, raise=0.1em}] (a.south west) -- (a.south east) coordinate [black,midway,yshift=-0.4em] (LA) {};
% \draw [decorate,decoration={brace, mirror, amplitude=3pt, raise=0.1em}] (b.south west) -- (b.south east) coordinate [black,midway,yshift=-0.4em] (LB) {};
\draw [decorate,decoration={brace, mirror, amplitude=3pt, raise=0.1em}] (b.south west) -- (b.south east) coordinate [black,midway,yshift=-0.4em] (LAB) {};
\draw [decorate,decoration={brace, mirror, amplitude=3pt, raise=0.1em}] (c.south west) -- (c.south east) coordinate [black,midway,yshift=-0.4em] (LC)  {};
\draw (LAB) |- (L-2-1);
% \draw (LA)  |- (L-3-1);
% \draw (LB)  |- (L-2-1);
\draw (LC)  |- (L-1-1);
\end{tikzpicture}
\end{document}