Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(components): migrate LoadingButton to TypeScript #584

Merged
merged 3 commits into from
May 5, 2020

Conversation

connor-baer
Copy link
Member

@connor-baer connor-baer commented May 3, 2020

Relates to #582.

Purpose

The LoadingButton had some complicated state logic to enable the small exit animations. A quick search revealed that these animations are only used once in the SumUp dashboard and partner portal. I decided that it's too much code for little benefit, plus an action's success or error result should be communicated outside the button.

Approach and changes

👀 Live preview

  • Migrate Spinner to TypeScript: The dark and active props have been removed. The spinner uses the currentColor CSS value for its color, so it adapts automatically. This brings it in line with @sumup/icons.
  • Migrate LoadingButton to TypeScript: The exit animations have been removed and the accessibility improved (I tested with a screen reader).

Definition of done

  • Development completed
  • Reviewers assigned
  • Unit and integration tests
  • Meets minimum browser support
  • Meets accessibility requirements

@connor-baer connor-baer added feature A new feature or enhancement ♿ accessibility Improves usability labels May 3, 2020
@connor-baer connor-baer added this to the v2.0 milestone May 3, 2020
@codecov
Copy link

codecov bot commented May 3, 2020

Codecov Report

❗ No coverage uploaded for pull request base (feature/button-enums@66d828a). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@                   Coverage Diff                   @@
##             feature/button-enums     #584   +/-   ##
=======================================================
  Coverage                        ?   93.38%           
=======================================================
  Files                           ?      145           
  Lines                           ?     2343           
  Branches                        ?      657           
=======================================================
  Hits                            ?     2188           
  Misses                          ?      128           
  Partials                        ?       27           

@vercel
Copy link

vercel bot commented May 3, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/sumup-oss/circuit-ui/fna3syt5d
✅ Preview: https://circuit-ui-git-feature-typescript-loading-button.sumup-oss.now.sh

Copy link
Member

@justman00 justman00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typescript components are coming to life 👏

Copy link
Contributor

@jmaslate jmaslate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙌

BREAKING CHANGE:
The LoadingButton's exit animations have been removed. An action's success or error result should be
communicated outside the button.
feature/typescript-loading-button
@connor-baer connor-baer changed the base branch from feature/button-enums to alpha May 5, 2020 08:59
@connor-baer connor-baer force-pushed the feature/typescript-loading-button branch from 8fa477b to b2e9d19 Compare May 5, 2020 08:59
@connor-baer connor-baer merged commit c96c851 into alpha May 5, 2020
@connor-baer connor-baer deleted the feature/typescript-loading-button branch May 5, 2020 09:00
@github-actions
Copy link
Contributor

github-actions bot commented May 5, 2020

🎉 This PR is included in version 2.0.0-alpha.15 🎉

The release is available on:

Your semantic-release bot 📦🚀

@fernandofleury
Copy link
Contributor

fernandofleury commented Jun 4, 2020

@connor-baer I'm seeing this now on #600. What do we plan to provide as a fallback for the transitions? Considering consumers will have to do it. Is this planned in the Design System? (Feedbacks in general).

The dashboard already has a "toast" system. But that wouldn't work for some contexts such as Modals (considering the backdrop styles)

I know we compose feedback with some components available, my question is more on the design system side and not component library

@connor-baer
Copy link
Member Author

@fernandofleury As I wrote in the PR description:

A quick search revealed that these animations are only used once in the SumUp dashboard and partner portal. [...] an action's success or error result should be communicated outside the button.

How the action result is displayed depends on the context, for example, it could be a message next to the button, a tooltip, or a toast message. It should be visible for at least 3 (5?) seconds and should not block the button from being blocked again (that's why displaying the result inside the button is a bad idea).

@github-actions
Copy link
Contributor

github-actions bot commented Jun 8, 2020

🎉 This PR is included in version 2.0.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@herberthenrique herberthenrique mentioned this pull request Jun 9, 2020
49 tasks
@github-actions
Copy link
Contributor

🎉 This PR is included in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
♿ accessibility Improves usability feature A new feature or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants