As a Ph.D. advisor, how do you feel about taking on students with diagnosed depression or bipolar disorder?
Speaking both as a PhD advisor and as someone with a diagnosed and controlled bipolar disorder, I would definitely consider a student with mental health issues. I would, much like awsoci discusses in their response, insist the student not treat the advisory relationship as a therapeutic outlet, and that the student lean on the available resources inside and outside campus.

My own PhD advisor (back in the day) knew about my issues, and the same holds true for all the PhD students with mental health problems I know right now.

All that said, there are risks with disclosing, and definitely with disclosing widely. There is no guarantee that any given PhD advisor would be fine with the situation, and even if there are anti-discrimination clauses available, the relationship might not work out well in the end if it starts out on a shaky basis.

To summarize: In principle and in theory, advisors should take on qualified students with disabilities. In practice, your mileage most likely will vary, but I personally would not let the disability be a deciding factor in taking on a student.