The role of capital requirements and credit composition in the transmission of macroeconomic and financial shocks