The Supreme Court has ruled that US President Donald Trump cannot use emergency powers to impose sweeping tariffs on foreign imports.