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(Meter): New component #1281

Merged
merged 31 commits into from
Nov 19, 2024
Merged

feat(Meter): New component #1281

merged 31 commits into from
Nov 19, 2024

Conversation

pladaria
Copy link
Member

@pladaria pladaria commented Oct 29, 2024

Milestones

  • Angular
  • Circular
  • Linear
  • Automatic width support (for non numeric widths)
  • Forward animation
  • Reverse animation
  • Accessibility
  • prefers-reduced-motion support
  • Workaround for small segments
  • Workaround for zero segment at the end
  • Non rounded lines depending on theme
  • Tests
  • Playroom Snippets

Implementation details

  • Using requestAnimationFrame for animation
  • Values array in the range [0..100] (like the progress bar)
  • Creating a full circle using the arc path has issues. When the start end end point are the same, it draws the circle in an unexpected direction. To avoid this effect, a very small threshold value is used to clamp (not noticeable, a small fraction of a px).

Copy link

github-actions bot commented Oct 29, 2024

Size stats

master this branch diff
Total JS 12.2 MB 12.2 MB +17 kB
JS without icons 1.99 MB 2 MB +16.9 kB
Lib overhead 68.7 kB 69 kB +271 B
Lib overhead (gzip) 16.8 kB 16.9 kB +105 B

Copy link

github-actions bot commented Oct 29, 2024

Accessibility report
✔️ No issues found

ℹ️ You can run this locally by executing yarn audit-accessibility.

Copy link

github-actions bot commented Oct 29, 2024

Deploy preview for mistica-web ready!

✅ Preview
https://mistica-rf1g4a0oq-flows-projects-65bb050e.vercel.app

Built with commit 3d8f7f9.
This pull request is being automatically deployed with vercel-action

@pladaria pladaria marked this pull request as ready for review November 8, 2024 13:56
Copy link
Contributor

Choose a reason for hiding this comment

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

With multiple values (stacked) the border is not visible during the animation

You can test it changing value 50 to 10 for example
https://tinyurl.com/2ysu72go

Copy link
Member Author

@pladaria pladaria Nov 13, 2024

Choose a reason for hiding this comment

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

This is expected, to better visualize what's happening instead of 0s use values of 1: [1, 50, 1, 1] => [1, 10, 1, 1].

The first segment is animated but during the transition, it goes behind the large one, so it is not visible. The last two ones aren't animated because their value doesn't change, so the only visible animated segment is the large one.

If you change the animation to "reverse" (adding the reverse prop), I guess you would get the effect you're expecting

@pladaria pladaria requested a review from yceballost November 13, 2024 17:15
Copy link
Contributor

@yceballost yceballost left a comment

Choose a reason for hiding this comment

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

nice job 🥰

Copy link
Contributor

@yceballost yceballost Nov 18, 2024

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

changed!

Copy link

github-actions bot commented Nov 19, 2024

Screenshot tests report

✔️ All passing

@pladaria pladaria enabled auto-merge November 19, 2024 11:44
@pladaria pladaria added this pull request to the merge queue Nov 19, 2024
Merged via the queue into master with commit 1a061d8 Nov 19, 2024
11 checks passed
@pladaria pladaria deleted the pladaria/WEB-2079_velocho branch November 19, 2024 12:06
tuentisre pushed a commit that referenced this pull request Nov 26, 2024
# [16.6.0](v16.5.0...v16.6.0) (2024-11-26)

### Features

* **data-testid:** support for Callout, HighlightedCard, Hero, EmptyState and Headers ([#1296](#1296)) ([15b798c](15b798c))
* **Header, Cards, Hero, CoverHero:** improve a11y ([#1292](#1292)) ([cdcf2fc](cdcf2fc))
* **InfoSheet:** update styles and allow adding a button to the content ([#1294](#1294)) ([c4a0749](c4a0749))
* **Meter:** New component ([#1281](#1281)) ([1a061d8](1a061d8))
* **Sheet:** allow closing the sheet with the keyboard or a screen reader ([#1293](#1293)) ([42099fb](42099fb))
@tuentisre
Copy link
Collaborator

🎉 This PR is included in version 16.6.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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants