  We investigate equilibrium properties, including structure of the order
parameter, superflow patterns, and thermodynamics of low-temperature surface
phases of layered d_{x^2-y^2}-wave superconductors in magnetic field. At zero
external magnetic field, time-reversal symmetry and continuous translational
symmetry along the edge are broken spontaneously in a second order phase
transition at a temperature $T^*\approx 0.18 T_c$, where $T_c$ is the
superconducting transition temperature. At the phase transition there is a jump
in the specific heat that scales with the ratio between the edge length $D$ and
layer area ${\cal A}$ as $(D\xi_0/{\cal A})\Delta C_d$, where $\Delta C_d$ is
the jump in the specific heat at the d-wave superconducting transition and
$\xi_0$ is the superconducting coherence length. The phase with broken symmetry
is characterized by a gauge invariant superfluid momentum ${\bf p}_s$ that
forms a non-trivial planar vector field with a chain of sources and sinks along
the edges with a period of approximately $12\xi_0$, and saddle point
disclinations in the interior. To find out the relative importance of
time-reversal and translational symmetry breaking we apply an external field
that breaks time-reversal symmetry explicitly. We find that the phase
transition into the state with the non-trivial ${\bf p}_s$ vector field keeps
its main signatures, and is still of second order. In the external field, the
saddle point disclinations are pushed towards the edges, and thereby a chain of
edge motifs are formed, where each motif contains a source, a sink, and a
saddle point. Due to a competing paramagnetic response at the edges, the phase
transition temperature $T^*$ is slowly suppressed with increasing magnetic
field strength, but the phase with broken symmetry survives into the mixed
state.
