The description of your symptoms suggests that you may have more than one thing going on. First, the symptom of blacking out can mean more than one thing. If blacking out means that you are actually passing out, then will require an evaluation for syncope
(medical term for passing out). Sometimes when people experience intense pain such as smashing their finger, their blood pressure decreases causing blood to fall from the head resulting in sudden blacking out. Since you say you black out when you kick your toe or smash your finger, then this is a possibility. Blacking out during a panic attack is often do to hyperventilation that occurs during the attack. When we hyperventilate, our blood levels of carbon dioxide reduce making the blood more alkaline. This results in lightheadedness and sometimes temporary vision loss. It is possible that the two are related. If you are a person that hyperventilates when they experience pain, then this could explain your symptoms completely.
I suggest that you schedule an appointment with your primary care physician
. He or she can can a more detailed history of these episodes and determine what they are. You will likely benefit from treatment for you panic attacks. This may help your prevent your blacking out symptoms.