If you are interested in how you'd design your own off-line switching power supply, I learned a lot on
Power Inetgrations' web site. They are one company that makes chips that are the brains (and sometimes muscle) of those power supplies. They have a lot of reference designs you can look at -- you enter in what input voltage, output voltage, and wattage you need, they give you a list of designs using their chips, and the designs include lists of the external parts you need, schematics, PCB layouts, and sometimes a bit of narration too.
One thing you'll find is the transformers are going to be the hardest thing to find. For commercial supplies, they'll be custom wound, and you'll have a really hard time finding an off-the-shelf transformer as small as the commercial supplies have.
If you just want to have a regular power cord going in to your widget without wasting a lot of space, you can buy pre-packaged power supplies that you can just drop on to your PCB. For example,
this one has similar specs. It's probably twice the size of the iphone adapter you linked, but easily half the size of what I'd be able to make on my own. And it's UL listed.