Legendgroup with sublist

I see that you can make legendgroups or keep all your traces as individual legend elements. Is it possible to combine them so I can either toggle by group or individual?

I’m imaging the legend would look like this:

◻︎Group A
     ◻︎A1
     ◻︎A2
☑︎Group B
     ☑︎B1
     ☑︎B2
☒Group C
     ◻︎C1
     ☑︎C1

Is this possible?

Not at the moment unfortunately