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

Issue 2162: ZUI Badge initial creation #2208

Merged
merged 1 commit into from
Sep 30, 2024

Conversation

KraftKatten
Copy link
Collaborator

@KraftKatten KraftKatten commented Sep 29, 2024

Description

This PR adds the ZUI Badge as defined in the Figma. There's two main variants, one with a number and one without. It also takes the status.

Screenshots

bild
bild
bild
bild

Changes

  • Adds the ZUIBadge component, with two main variants:
  • Adds Dot variant: Small dot with no number, in the colour of the status.
  • Adds Badge variant: Slightly bigger with a number. Can handle negative numbers, and shortens numbers to 99+ if larger than 99. Does not handle very large (or small? 😅) negative numbers well, for example:
    bild

Notes to reviewer

The sizes of the circles are slightly bigger than in design, but the numbers didn't really fit otherwise. I also took liberties in allowing negative numbers, but I don't really expect it to happen, so I think it's alright that we don't really handle very large negative numbers. The "99+" functionality was approved by a designer, but I'm not completely sure it's the best solution. perhaps we could just do a "..." or something. Not sure how often it would happen. Finally, not completely sure if the font is correct compared to design either 😅

Related issues

Resolves #2162

@KraftKatten KraftKatten linked an issue Sep 29, 2024 that may be closed by this pull request
4 tasks
Copy link
Contributor

@ziggabyte ziggabyte left a comment

Choose a reason for hiding this comment

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

Awesome job! I think it looks great so far :D Agree that we will probably not need to handle very large negative numbers, so not fitting for that is fine.

I'm going to approve and merge it, and I'll look at the font size/badge size issue and talk with the designer if needed :) Thank you so much for this!

@ziggabyte ziggabyte merged commit ffa7c1a into undocumented/new-design-system Sep 30, 2024
5 of 6 checks passed
@ziggabyte ziggabyte deleted the issue-2162/zui-badge branch September 30, 2024 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🧱 ZUI: Badge
2 participants