Preheat the oven to 350°F (175°C) and line a 12-cup muffin pan with cupcake liners.
Whisk together the flour, baking powder, cinnamon, and salt in a medium bowl.
In a separate bowl, beat the softened butter and granulated sugar for 2 to 3 minutes, until light and fluffy
Beat in the eggs one at a time, then mix in the vanilla.
Add the dry ingredients alternately with the milk, beginning and ending with the dry ingredients. Mix just until combined
For the apple filling, combine the diced apples, butter, brown sugar, cinnamon, nutmeg, lemon juice, and water in a small saucepan.
Cook over medium heat for 5 to 7 minutes, stirring occasionally, until the apples are tender but still hold their shape. Cool slightly
Divide the cupcake batter evenly among the liners, filling each about two-thirds full
Bake for 18 to 22 minutes, or until the cupcakes spring back lightly and a toothpick inserted into the cake comes out clean.
Cool in the pan for 5 minutes, then transfer to a wire rack and cool completely
For the buttercream, beat the softened butter until smooth. Gradually add the powdered sugar, then mix in the maple syrup, vanilla, and salt
Add the heavy cream or milk gradually and beat until the frosting is light and fluffy
Cut a small opening in the center of each cooled cupcake and fill with the apple mixture.
Pipe the maple buttercream over each cupcake. Finish with a small spoonful of apple filling or a sprinkle of cinnamon, if desired.