Putting the G540, the stepper motor power supply, and the SmartBOB in the same enclosure is fine.
Things to worry about are power wires to a brush type spindle motor, power wires to or from a VFD, or the power cable to a plasma torch. The plasma torch cable should never pass through the control enclosure. If the power wires to a spindle or VFD are passing through the control cabinet, try to separate them from the input signals and USB cable as far a possible.