Preheat the oven to 350°F (175°C). Line a 12-cup muffin pan with cupcake liners.
In a medium bowl, whisk together the flour, baking powder, baking soda, salt, cinnamon, nutmeg, and ginger. Set aside.
In a large bowl, whisk together the granulated sugar, brown sugar, eggs, oil, and vanilla extract until well combined.
Pour the dry ingredients to the wet ingredients, whisking, or using an electric mixer on low speed to stir just combined (do not over mix). Fold in the grated carrots, nuts, and raisins if using.
Divide the batter evenly among the cupcake liners, filling each about ⅔ full. Bake for 20 minutes, or until a toothpick inserted in the center comes out clean. Let the cupcakes cool in the pan for 5 minutes, then transfer to a wire rack to cool completely.
In a large bowl, beat the butter and cream cheese together until smooth and creamy. Add the powdered sugar, vanilla extract, and salt, and beat until fluffy and well combined.
To make the carrots on top of the cupcakes, take about 1 cup of frosting and use gel good coloring to dye about ¾ of it orange, and the remaining ¼ cup green. Fit a piping bag with a #10 round tip for the orange frosting and another bag with a small leaf tip for the green frosting.
Place the remaining plain frosting in a piping bag fitted with the tip of choice. I used a 4B.
Frost the cupcakes with the plain white frosting, then coat the sides in nuts. Then pipe the carrot body on top by holding the orange piping bag at a 45-degree angle and creating a teardrop or triangle shape, starting wide and tapering to a point.
Pipe the leaf on top of the carrot.
Store any leftover cupcakes in the refrigerator in an air tight container for up to 5 days.
The cupcakes can be frozen for up to 2 months.
