Error while building panel plugin GraphWithLegend 7.0.0 - React

I’m trying to develop a simple panel. Everything works fine except when I try to import the ‘Legend’ component. I get the following error:

Other imports like 'import {…} from ‘@grafana/ui/components/Graph/GraphWithLegend’ work. My package.json has the @grafana ui, data, toolkit in 7.0.0.

Can somebody help me please?