Most power supplies are the same physical size but you need to pay attention to the AC connectors on them. Some are more centered and will be a pain if not impossible to use with a G4.
My favorite brand/model to use in G4s is the Thermaltake TR2. It is about 3/4" deeper than normal though, so if you have an original ancient optical drive, it may be a tight fit. You can choose another brand, of course, but I would recommend against anything under $30 normal price.. they're just not very reliable.
I have built adapter kits that will work with B&W G3s/Yikes/Sawtooths that are plug & play, if you're interested. The kit takes care of the motherboard connector and also provides a power connection for the Apple fan. I've been selling the kits for $12 shipped while supplies last. The adapters will work with any 20 or 24 pin power supply.
I had built those kits as a bit of expansion to my Gig-e/DA adapter project which I've almost abandoned due to unexpected quirks popping up. The Sawtooth adapters are quirk-free though, so long as you buy a reliable power supply.