Decathlon / vitamin-web

Decathlon Design System UI components for web applications
https://decathlon.github.io/vitamin-web
Apache License 2.0
282 stars 76 forks source link

fix(@VtmnReact): allow badge component to have 0 as a value #1462

Closed romuleald closed 1 year ago

romuleald commented 1 year ago

Changes description

Badge doesn't accept 0 as a value, but instead it's showing an empty string image image

Context

It should accept 0 as a value as fixed here

image

Checklist

Does this introduce a breaking change?

Other information

Tlahey commented 1 year ago

Hello @romuleald thanks for your PR. But as the DS website says https://www.decathlon.design/726f8c765/p/465f7c-badge/b/587b7e The display 0 should not be exist. image

If you really wan't to display 0, you can do a workaround on your side and set it as a string.

thibault-mahe commented 1 year ago

Hi @romuleald, thank you for suggesting this PR.

We've checked with the designers and, as @Tlahey also points out in his comment, this choice is indeed a documented design decision.

Given current priorities and our resources, there are no plans to change this behavior on this version of Vitamin. On the other hand, we're taking good note of it so that we can take it into account in the new version we're currently working on.

I'm therefore closing this PR, but do note we're very grateful for the time you spent suggesting this code.

Thanks!