swisspost / design-system

The Swiss Post Design System - for a consistent and accessible user experience across the web platform.
https://design-system.post.ch
Apache License 2.0
126 stars 14 forks source link

[component]: Button #3492

Closed gfellerph closed 3 weeks ago

gfellerph commented 2 months ago

Description

Create the button component with tokens and new styles. The button should be backwards compatible with v1, this means that the same selectors should be used to style buttons. In addition to that, style default buttons (buttons without classes) as secondary buttons and submit buttons as primary buttons.

Design

https://www.figma.com/design/JIT5AdGYqv6bDRpfBPV8XR/Foundations-%26-Components-Next-Level?node-id=17-163

Tokens

Development

The button should be backwards compatible, therefore the current class selectors should stay the same for the new Design. Additionally, buttons without any classes should be styled as follows:

There are no animated buttons anymore. Remove the animated button styles and create a breaking changeset for these. Also, create an optional migration, because there is no need to update the button html structure, the class btn-animated will not do anything and the span inside does not hurt.

Tasks

### 💻 Tasks
- [x] Review Design (All states present? Possible to implement?)
- [ ] https://github.com/swisspost/design-system/issues/3496
- [x] HTML/CSS implementation
- [x] Variants: Primary, Secondary, Tertiary, Icon only
- [ ] Style buttons without classes according to type
- [x] Remove animated button styles
- [ ] Write optional migration instructions to remove animated buttons from code
- [x] Documentation in Storybook
- [x] Visual regression tests
- [x] Design review
oliverschuerch commented 2 months ago

@Cian77 Could you update the focus styles for the button accordingly to what you did for the text-input?

oliverschuerch commented 2 months ago

@Vandapanda please add the disabled stroke tokens here as well:

Vandapanda commented 2 months ago

@oliverschuerch @gfellerph

Changed focus styles accordingly

Token can be found as

gfellerph commented 1 month ago

See resolution on #3710 for sizing class handling