It's illegal in my state in the US. Also if you do FMLA in the US it would be illegal if you're the parent who gave birth. Outside of a few states here in the US you're basically expected back at work as soon as you get out of the hospital unless you have a doctor's note.