Trip from San Francisco to Santa Clarita via Yosemite NP

My family plans to take a two day trip from San Francisco to Santa Clarita via Yosemite NP. We want to spend at least a full day in Yosemit NP. Could you tell me what route is the best (H140 to the Villeage to Mariposa, then to Santa Clarita)? Any suggestions to places to stay two nights?

Thanks