First, how old is she? Second, does she have anxiety problems with other things as well or is it just this one thing that triggered it? Her age is important, because if she's really young that's different than if she's not. You also say she got panic attacks -- do you mean a genuine panic attack, which is a pretty intense thing, or she got very upset and emotional and you're calling it a panic attack? There's two possibilities here -- she can't handle romantic adversity, that's a very very common thing, and she's apparently over reacting to what seems like a relationship that wasn't even a real relationship as it doesn't appear they spent time romantically together for any length of time. Or, he did something to her. Because while some people get really sad and empty from a breakup, they don't get scared of the person. We have no idea what the whole story is, only the tiny bit you've mentioned, and if what you describe is all that happened and your friend isn't extremely young and inexperienced, this reaction is way over the top and indicates something else entirely is going on and that is what needs looking into, perhaps by a therapist. If he did something to her, you have a very different story. All break-ups are hard, but if you're not having sex with someone and you're not in a long-term love relationship, well, they do come and go, you know? To react this way to something that hadn't actually formed yet is quite odd. If you're also very young, not much you can do but stay her friend, but again, I've had several very sad break-ups in my life but they all followed a long relationship that was quite intimate. Can't imagine this much drama over a crush. So again, needs looking into by adults and perhaps a therapist.
I'm sorry to your friend about her situation. When someone is a big part of your life and very special to you, who you have feelings for and they also have/had feelings for you, if they suddenly start seeing someone else and treat you like you basically don't exist, that is very abrupt and jarring and also doesn't sound very nice on the boy's part from what you've shared. I think having dreams, getting emotional, feeling maybe a little less secure when someone suddenly leaves you like that are all normal.
I think the other commenter's questions at the start are good, but I disagree that sex has to play a part in it at all. I'm not sure why someone would think that you cannot think someone is special, or be close with someone, or have a relationship with someone, without having sex with that person. There are many relationships where sex is not involved, and if you and your friend are in high school, for example, most high schoolers do not have sex, many if not most even their first kiss. Relationships and connections are more than sexual and in fact bringing in sex can confuse things and can be negative in many ways.
Being "scared" of the boy sounds odd. I could see feeling sort of "scared" or shaken when the rug is pulled out from under you suddenly, and maybe being reminded of him (like seeing his name) triggers that at the moment. I could see what happened undermining your friend's trust towards others and being shocking, so maybe it's that. As long as there was no abuse and that sort of thing, I think you could just be her friend like you are. Listen to her, hang out with her, allow her to process this I suppose. And you probably know best because you know the details of the situation and of people involved. I hope it works out as best it can.
Ah, I'm sorry about your friend! It's really hard to see our friends and loved ones suffer. Panic attacks feel horrible. Break ups feel really bad too and especially messy ones where they kind of ditch you. Your friend is maybe in a little shock and mourning and upset. Time often heals these things. Now clinical anxiety and panic can be situation or triggered by an event. Learning what to do at that time is important. Breathing exercises, distracting yourself, etc. can help. But if your friend has had a lot of anxiety for a long time and this is just something making it even worse, it may be time for her to talk to someone about it. First, if she is a minor, she should talk to her trusted parent or another trusted adult. That's really important as that is how she would have access to say something like a therapist which could be wonderful to work through this with. They do a lot of therapy online these days. I belong to a support group for parents of teens with anxiety and depression and many kids right now as we speak get tremendous help from some of the online counseling services offered.
I also agree with helper015 that no one can judge how someone feels or how close they are to someone and if sex makes them closer or not. That is irrelevant to your friend's feelings. As you get older, as you get more intimate, closeness grows but particularly in young people, the emotions of romance are very deep. And I'm sure this boy mattered to your friend. Rejection really hurts. I don't read your post that she was abused or hurt by him other than rejection. If she was, that's a different story. But as a parent of kids in their teen years, I have seen many spiral after a break up. It hurts. I'm sorry your friend is going through that.
Anyway, let us know how we can help or how your friend is doing. You are good to her to be concerned.