I have divulged my mental illness to a few direct supervisors. I'm a teacher, and it's very difficult to have to be absent due to hospitalization without giving notice, lots of preparation, and explaining why you will be gone. Teachers just can't take off that kind of time without explanation. I suppose I could have lied and told them it was for some other medical reason, but they would have asked what hospital, etc. so they could visit, etc. (We're a pretty close-knit group.) So, I did let my supervisors know just enough to realize what was going on (and that visitation was not an option

). I don't give details about my issues or treatment because (a) they really don't want to know, and (b) it really isn't their business.
Everyone has been extremely supportive, helpful, and discrete. Fortunately, I work with real professionals who know how to keep things confidential and how to treat others with respect. That doesn't exist in every workplace. You do have to be careful. I rarely talk about my mental health with anyone at work. There is a time and place for everything, and work just isn't the place. That's why I have therapists and a pdoc.