I'd use this circuit attached to protect from reverse polarity by use of that diode. The Voltage regulator I would mount to a passive heatsink. Thats why it has that metal backing with the hole through it is to be mounted to a heatsink to draw heat away. A small drop of thermal compound the same used for CPU and GPU heatsinks on computers and this mounted to the flat of a flat unpainted bare metal surface for best results. Not quite sure why making as small as possible is a concern as for there is not much to this circuit anyways with just a diode, voltage regulator, and 2 capacitors. Biggest concern is you said its for a motorbike battery, so I am assuming this is for a motorcycle that is exposed to moisture from rain, puddles and all that. You would then want this PCB to be protected from the weather. One option is to places it into a box of some sort and then pour silicone epoxy all around it to encase the circuit board in a barrier from water. BUT that voltage regulator is going to produce heat and so you need to have the metal that its mounted to exposed and not encased in silicone gel. The silicone gel is the same as used for caulking etc, where it takes about 24 hours or so to set.
On some other projects I had that I wanted water proof I used a 2-part epoxy that mixes evenly with a syringe. I made use of a empty clear TIC-TAC container which had the opening where TIC-TACs normally exit for a USB cable to pass through. I popped this piece out threaded my USB cable through TIC-TAC hole and then soldered the 4 USB wires to my small PCB, and then placed the board into the clear TIC-TAC container and injected this 2 part epoxy into the TIC-TAC container, and then slid the white plastic TIC-TAC container top down the USB cord and snapped it back into the TIC-TAC container body and then the epoxy gave off heat as it was solidifying, then cooled. Now my device i made was protected from water from the length of wire all the way to device encapsulated inside the epoxy.
You can get creative and reuse containers.
One such container that comes to mind for your application is an altoids container. Its a metal container that is sold with the mints. You could mount the voltage regulator to the bottom of the altoids case and use the entire metal surface of it as a passive cooler. The surface area of the altoid case should be plenty to keep that voltage regulator cool especially with the top lid on it as well to draw heat away. Use of a long screw to mount the voltage regulator to the bottom flat of the tin with thermal compound, and a nut tight on the outside bottom of your tin. The extra length of screw used to mount it to your motorbike with 2 washers and a nut at the final end of it were ever it mounts. 1 long screw should be plenty since its light and nothing should bump it to snap that screw off. The screw also will act as a passive heatsink to whatever metal surface that is mounted and tightened to.
The heat produced will be determined by the draw through it, the closer you get to maximum current draw, the hotter its going to get.
If you go with altoid case, I would pour silicone gel caulk into it once your sure your circuit was successful. You will want to use like an old credit card or something on the bottom of your PCB to avoid the solder connections from shorting out on the altoid case. I have used expired credit cards for stuff like that insulators. As long as its the older cards that dont have any metal on them to short to that is. The newer credit cards with embedded chips have a few electrical connections on them that could short a circuit if used, but older plastic credit cards or store cards etc they make good insulators.
I love to recycle and repurpose empty containers from stuff to save myself from having to buy cases for projects. Seems as though candy containers work awesome for small container needs.
Lastly, make sure your not going to pull greater than 1.5 amps through this. Some phones are fine on 1.5 amps, but such as if you have a tablet that charges off of a microUSB it could pull around 2.5 amps. If you have a wall charger for this phone and it says 1.5 amps or less on it for the 5V then you should be fine, but if its a greater draw then you will need a drop down voltage regulation circuit that can handle the current demands of the battery charge.
One thing I would also consider is why reinvent the wheel. If you can pick up a car charger for your phone then simply mount a fused linked cigarette lighter plug to motorbike somewhere and use that for 12volt accessory power direct tap from battery ( with a 3 amp fuse in series with it in case you ever have a short circuit. )
https://www.delcity.net/store/Auxiliary-12-Volt-Power-Socket/p_801417.h_801418.r_IF1003?mkwid=sbFzvw7JK&crid=38094426869&mp_kw=&mp_mt=&gclid=EAIaIQobChMIk-7R34TP1AIVxIuzCh3ruwBnEAQYASABEgLpZvD_BwEYou then can power all sorts of stuff through this 12VDC aux outlet and greater than just 1.5 amps. Also if moisture is ever a problem the worst case scenario is having to replace the aux outlet. I am assuming your going to only be charging when good weather. The phone charger is also removed from bike when not needed to be plugged into it which will protect from draining your battery dead!
One thing to consider is you will want to have a switch or even safer a relay to only have that 5 volt power working when the bike is running as for even with nothing plugged into the 5 volt side of that circuit, it has a continuous draw of a small amount of power that will drain a battery dead. Relay would tap into use of sensing a run state of the motorbike to energize the coil of relay which then energizes the 5 volt power circuit you need. If you go with the 12Volt aux outlet, you wouldnt need this switch or relay and as long as you remove whatever is plugged into it then your battery wont drain from it.
[attachment deleted by admin to conserve space]