vmware-archive / clarity

Clarity is a scalable, accessible, customizable, open source design system built with web components. Works with any JavaScript framework, built for enterprises, and designed to be inclusive.
http://clarity.design
MIT License
6.42k stars 761 forks source link

feat(core): action button #6505

Closed coryrylan closed 2 years ago

coryrylan commented 2 years ago

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

What is the new behavior?

https://61ba7ce549e858a779684d11--vmware-clarity.netlify.app/storybook/core/index.html?path=/story/components-button-action--page

Does this PR introduce a breaking change?

Other information

Screen Shot 2021-12-07 at 4 31 16 PM

coryrylan commented 2 years ago

@ashleyryan good callout! There are a couple of differences between the action and button components but potential opportunity to consolidate as well. The action button consolidates all the custom icon style buttons internally in the system like close, expand, and various control/form actions.

The cds-button has a lot of option/types that we would want to keep separate (for now). This includes visual options like statuses, sizes and loading. But primarily they have specific aria/a11y states like sorting, pressed/drag and expanded. If possible we try to avoid "impossible states" in the component APIs specifically with this case the a11y differences/complexities. I'm also hoping to avoid any "mega" components even if that means multiple derivative types.

However you got me thinking about a possible way to rename on the actions. I think I can rename the actions to better align with existing cds-button-* conventions and consolidate the API a bit with no breaking changes. I'll post back here and slack with what I find. Thanks!