New Zealander contributing here. Jacinda did not know she was pregnant during the election, but found out during talks with a coalition party when a government was being formed after the election. She has said they were told that falling pregnant naturally probably wouldn’t be an option for her and her husband, so it was a total surprise for them.
As a kiwi who didn’t vote for her, I’m still very happy for her and her husband, and don’t have any concerns about the running of the country while she’s on maternity leave. There are certainly some ‘backward’ and negative comments coming from some people, but I would say the majority of NZers are just happy for her and ready to move on to the next piece of news for the day!