For $\mathfrak{g}$ a Lie algebra, the groupoid of $\mathfrak{g}$-valued forms is the groupoid whose objects are differential 1-forms with values on $\mathfrak{g}$, and whose morphisms are gauge transformations between these.
This carries the structure of a generalized Lie groupoid $\mathbf{B}G_{conn}$ , which is a differential refinement of the delooping Lie groupoid $\mathbf{B}G$ of the Lie group $G$ corresponding to $\mathfrak{g}$:
its $U$-parameterized smooth families of objects are Lie algebra valued differential forms on $U$. Its $U$-parameterized families of morphisms are gauge transformations of these forms by $G$-valued smooth functions on $U$.
A cocycle with coefficients in $\mathbf{B}G_{conn}$ is a connection on a bundle.
For more discussion of this see ∞-Lie groupoid – Lie groups.
For $G$ a Lie group the groupoid of $Lie(G)$-valued differential forms is as a groupoid internal to smooth spaces, the sheaf of groupoids
that to a smooth test space $U \in Diff$ assigns the functor category $[P_1(U),\mathbf{B}G]$ of smooth functors (functors internal to smooth spaces) from the path groupoid $P_1(U)$ of $U$ to the one-object delooping groupoid $\mathbf{B}G$.
The groupoid $\bar \mathbf{B}G$ is canonically equivalent to the smooth groupoid where
Here $\bar \theta$ is the right invariant Maurer-Cartan form on $G$. A common way to write this is $A' = Ad_h(A) + h d h^{-1}$.
A proof is in SchrWalI.
The cohomology with coefficients in $\bar \mathbf{B}G$ classifies $G$-principal bundles connection on a bundle with connection.
More is true: there is a natural canonical equivalence of groupoids
There is the obvious projection
Lifting a $G$-cocycle through this projection to a differential $G$-cocycle means equipping it with a connection.
For $G = U(n)$ these differential cocycles model the Yang-Mills field in physics.
For $G = U(1)$ the sheaf $\bar \mathbf{B}U(1)(-)$ coincides with the the Deligne complex in degree 2, $\bar \mathbf{B}U(1)\simeq \mathbb{Z}(2)_D^\infty$, as described there.
groupoid of Lie-algebra valued forms
Details are in
The definition in terms of differential forms is def 4.6 there. The equivalence to $[P_1(-), \mathbf{B}G]$ is proposition 4.7.
See also ∞-Chern-Weil theory introduction