Basically, you have this, right?
Also, you have a 30V power supply and a L7805CV-DG voltage regulator as shown below.
You mentioned that L7805CV-DG is powering:
• ESP32 (assuming 70mA, I assumed this current consumption according to this link, if everyone knows the current consumption please tell us)
• Shift registers (16 mA, see below to know how I asumme this value that include both registers)
• 5V 40 x 40 mm Fan (asumming 0.15A, can you tell us the current?)
According to the datasheet, the ULN2803 has this inside, i.e., a Darlington transistor, these transistors need a base current to be activated:
The necessary input current Ii to activate the transistor is
Let’s average this current so that Ii = 1.14 mA per channel. At the instant all 7 segments are ON, the total current will be:

The maximum current of both shift registers will be 7.98 mA * 2 = 15.96 mA or 16 mA to round up.
So, the L7805CV will supply a current equal to:

Now, let’s see the thermal considerations for linear regulators:
The difference between the input voltage and output voltage with fixed load current is energy that is dissipated by the linear regulator. Nearly all of this energy is converted to heat.
Since our system must observe physics and the conservation of energy, we can use our knowledge of VI , VO, and current to identify how power is distributed in our LDO.
The input power in our LDO is:

The power delivered to the load is:

The difference between Pi and Po is the power that is burned or dissipated by the regulator. This dissipated Power (P_D) is:

However, remember that Ii roughly equals to Io, so

PD is almost entirely heat dissipated by the linear regulator.
Now if we have Vi = 30V, Vo = 5V and Io = 236mA, then:

Is the package of our L7805CV-DG (TO-220) able to withstand this heat? Let’s see…
Now we are going to examine the thermal considerations P_D generates:
The following equation liks P_D to the thermal specifications for a linear regulator

Where:
θJA = junction to ambient - °C/W
TJ = junction temperature rating - °C
TA = Ambient Temperature - °C
PD = power dissipated in watts - W
Equation 8 enables us to relate power dissipation with the thermal characteristics of the die/package combination and ambient temperature.
This equation is useful as TJ, TA and θJA are often known quantities in an application. By using these three known values, equation 8 will tell us what value of PD is necessary in order to have enough thermal conductance or thermal dissipation capability for our linear regulator in a particular application.
**if the value of PD given in (8) is greater than the value calculated in (6) then the LDO will capable of support **
Most vendors specify θJA in a linear regulator datasheet, for example for the case of our L7805CV-DG, θJA is 50 °C/W:
Also, the maximum Tj is 125 °C
So far, we have the following values
PD = 5.9W
θJA = 50 °C/W
TA = 25 (we are going to assume an ambient temperature equal to 25°C)
We are going to use equation (8) to get the permissible dissipated power of our LDO

So, what's going on here?
Your main problem is your 30V input voltage, the differente Vi - Vo is too high!! You must reduce the input voltage for your l7805
Before connecting the LED's, only your ESP is active, so:
using equation (6)
PD = (30V - 5)(70 mA) = 1.75W this value is less than the value given in (9) for this reason there is no problem when LEDs are not active