Telefonica / mistica-web

React components library for Telefonica Design System (Mistica)
https://mistica-web.now.sh
MIT License
47 stars 8 forks source link

Checkbox should be able to support isMandatory #1160

Open dominik-petschenka-syzygy opened 1 week ago

dominik-petschenka-syzygy commented 1 week ago

In some forms we need checkboxes that have to be checked for the user to proceed.

Right now we have to implement our own state handling and validation for these checkboxes.

It would be great if the Checkbox component would support isMandatory out of the box. It should prevent the form from being submitted and render a colored indication or similar like the Select and TextField.

pladaria commented 5 days ago

Thanks for your suggestion. We will discuss this feature with the design team

marcoskolodny commented 5 days ago

Hello @dominik-petschenka-syzygy. Thank you for your suggestion! :)

We need to review this with the design team. In the future, you may want to open a discussion in the mistica-design repo instead: https://github.com/Telefonica/mistica-design/discussions

pladaria commented 5 days ago

Our current design specs for this use case say:

When checkboxes are used in forms for legal conditions or other types of information that prevent the process from continuing without acceptance, we will display an alert/dialog to the user explaining that they need to accept the respective field

Example implementation

Design Team will review this anyway