element-hq / compound

Element's design system
https://compound.element.io
Apache License 2.0
12 stars 3 forks source link

Support primary destructive button type on Web #272

Open weeman1337 opened 10 months ago

weeman1337 commented 10 months ago

Compound designs differentiate between „primary destructive“ and „secondary destructive“ buttons.

image

https://www.figma.com/file/rTaQE2nIUSLav4Tg3nozq7/Compound-Web-Components?type=design&node-id=636-4&mode=design&t=RQVCJaX5SNce2GlF-0


Current Web implementation only supports one kind = primary, secondary, tertiary or destructive.

image


I am happy to contribute here. But we should decide about how we do it, e.g.:

kerryarchibald commented 10 months ago

I favour the second option - adding new button kinds for the destructive variants. Right now all the kinds support a destructive variant - so the second prop destructive would work well - but it's possible that won't be the case in future. I think we can deprecate destructive with a console warning, and treat it as primary-destructive until it is removed. @weeman1337

janogarcia commented 10 months ago

Agree with @kerryarchibald. That's how it's set up in Figma, too.

One minor exception, though. On Figma, we consistently use "Type" (Primary, Secondary, Tertiary, Primary Destructive, etc.) rather than "Kind" for the main variant property name. Unsure why it got named "kind" on the implementation side.