I think you should look at your own reaction: ashamed, frustrated, angry, depressed. Is that warranted here? Your daughter did this, not you. It's up to you to be strong, focused and direct. The problem here is not that you have been shamed by her, but that she has done something wrong.
How the other girl treats your daughter is irrelevant. Your daughter doesn't have to hang out with her, but she doesn't get to "pay her back" (if that's what it was) by stealing.
She needs to return the book, in person. She should apologize, but she should also have to sit down ahead of time and write an apology letter. That should include a statement that what she did was wrong and hurtful to the other girl, not just a "Sorry I got caught" sort of message. "I'm sorry" is an empty statement if it doesn't come with real insight. Having to apologize and face the other girl (and her parents) is a pretty strong motivator not to do this again. Do NOT do the talking for her, do not say "She's sorry" or "I'm sorry" and do not say that YOU are embarrassed. Let this all sit on your daughter's shoulders.
The less yelling and "bursting" you do here, the more effective you will be. Stealing is something that most every kid does at least once, so the thing to do is prevent it from recurring by making the consequences far more embarrassing or painful than the pleasure from the theft. But it has to fit the "crime." Taking away TV for a full month, for example, is probably way over the top. But taking it away for a week, or whatever other luxury your daughter enjoys, is effective. In her spare time today with no play date or TV or whatever, she can write a letter to the girl. Tomorrow, she can write you a paragraph on her thoughts about stealing, and the next day she can write a little essay on her thoughts about lying. That can include why she thinks it's wrong, and what she thinks would be an appropriate consequence. It would be very interesting for you to learn her thoughts here, to see what insight she has gained, and to see how serious she thinks this is.
If you position yourself as the authority figure here, as her teacher of behavior and manners and right-thinking, rather than the victim (someone who is depressed or ashamed), then you will both come out of this much better.
My son was a little younger than your daughter when he stole something from a hardware store - nothing valuable, just some pegs he thought were cool. He also lied about them the first time I saw them and said he didn't know where they came from. It wasn't until the next trip to the store that I saw the bin of pegs and put it all together. I called the store manager and told them what happened, said I was on my way down with my son, and asked that they say anything they wanted to except, "It's okay, little boy. No harm done." They handled it great, and my son was pretty nervous in the car all the way down and also when he got up to the counter. All I said was, "Tell the manager what you came here to say." Then I let them handle it. It never happened again.