A polynomial-chaos-expansion-based building block approach for stochastic analysis of photonic circuits