US President Donald Trump has signed legislation calling for sanctions over the repression of China's Uyghurs, a move met with retaliatory threats from Beijing.