The state Legislature has passed a bill that would limit the use of solitary confinement in New York.