A US district judge has temporarily restrained President Donald Trump's executive order on birthright citizenship, labelling it unconstitutional.