Esri / calcite-design-system

A monorepo containing the packages for Esri's Calcite Design System
https://developers.arcgis.com/calcite-design-system/
Other
293 stars 75 forks source link

[calcite-loader] Allow a way to display percent sign on the determinate value #8678

Closed rpanichakit9541 closed 3 months ago

rpanichakit9541 commented 9 months ago

Check existing issues

Description

Currently the value of the determinate loader just displays as a number which the user can mistake as the count number of items done instead of the percentage of completion. This is a request to be able to set a prop to tell the calcite-loader component to display the percent sign next to the number value.

Acceptance Criteria

The user should be able to set a prop on the calcite-loader component to tell it to display a percent sign next to the percent value

Relevant Info

No response

Which Component

calcite-loader

Example Use Case

No response

Priority impact

p4 - not time sensitive

Calcite package

Esri team

ArcGIS Online

mpriour commented 5 months ago

This issue is now impacting us in ArcGIS Online. We would really like this enhancement before the fall release of ArcGIS Online if at all possible.

geospatialem commented 5 months ago

For design expertise 🧠 : Should we also support the "%" when the value is 100?

geospatialem commented 5 months ago

Discussed the above with Skye, where they recommend the following:

We should always display the percentage for the value, even when the value is at 100%. However, it is recommended once the component reaches 100% to remove the loading state.

Additionally, in looking at other design systems, which use a circular progress similar to our determinate loader, it is common to not have the percentage by default, so we should explore adding the percentage as a new property.

Resources:

github-actions[bot] commented 5 months ago

cc @geospatialem, @brittneytewks

SkyeSeitz commented 3 months ago

Would like to propose closing in favor of 4470, where we are exploring renaming the current Loader type value to determinate-numeric which displays a number out of 100 (there was not sufficient space to warrant adding a percentage suffix) and adding an additional Loader type value that is just determinate, which removes the number to avoid confusion.

image
rpanichakit9541 commented 3 months ago

@SkyeSeitz - I'm not quite clear on the meaning of your comment. I took a look at https://github.com/Esri/calcite-design-system/issues/8735 you referenced, but didn't see anything that has to do with the number labeling. Will the new solution you are proposing allow the user of calcite-loader to be able to label it with a percent sign?

SkyeSeitz commented 3 months ago

Apologies, @rpanichakit9541! It looks like we can address adding the percentage sign in this issue. Easy addition with only one font-size adjustment needed to fit the extra "%" character at the small scale (outlined below).

image

We can add this percentage affordance as a new value to the type property.

image

Link to Figma file: https://www.figma.com/design/7BIhM7Anfkp0pdv03cFfFg/%5BLoader%5D-percent-sign?node-id=1-2&t=rxtPGEZmxgSjeQUA-11

jcfranco commented 3 months ago

Note that there will be a minor visual change for small scale, determinate loaders.

github-actions[bot] commented 3 months ago

Installed and assigned for verification.

jcfranco commented 3 months ago

Additional note: the current determinate type will no longer display a label in a future release.

DitwanP commented 3 months ago

🍡 Verified on 2.12.0-next.26 https://codepen.io/Ditwan-Price/pen/zYVWvEB