dxc-technology / halstack-react

Library of components for building SPAs with React and Halstack Design System
https://developer.dxc.com/halstack/
Apache License 2.0
15 stars 14 forks source link

[DxcDropdown] new props "disabled" & "mode" for the options #1747

Open AlanPadi95 opened 11 months ago

AlanPadi95 commented 11 months ago

Is your feature request related to a problem? Please describe. First, we need a way to disable an option without disabling the entire dropdown. Some of the options in the dropdown could be disabled because a user does not have permission to click on them.

Also, we need to show priorities between the different options. In most of our cases, some options are more relevant than others and we need a way to show this importance in an understandable way for the users.

Describe the solution you'd like The solution to disable options is to add a prop disabled and make them unable to interact.

To implement different priorities for each option in the dropdown, we can use the current implementation of the mode prop that we have in the DxcButton, including the new one suggested on [DxcButton] "danger" mode. By default, this mode should be "text" to not change the current approach. The danger mode should show the action on a red background such as in the DxcButton.

Describe alternatives you've considered N/A

Additional context An example use case:

image

The first option should have primary as the value of the mode prop and the last option should have danger as the value of that prop. The options in the image could be disabled if, for example, a user has permission to edit the resource but not to delete it.

Add Labels SaaSOps Automation, CSAM Applications, DxcDropdown.

AlanPadi95 commented 11 months ago

Another suggestion to use the dropdown with the modes and priorities is to set the primary option as a button and the other options in the dropdown when is expanded. Example in Outlook:

image

github-actions[bot] commented 9 months ago

This issue is stale because it has been open for 15 days with no activity. If there are no further updates or modifications within the next 15 days, it will be automatically closed.

AlanPadi95 commented 9 months ago

Hey, guys!

Could you please share any updates on this issue?

The GitHub bot would close the issue if there are not any updates on it.

Thank you all in advance! 🥰

Mil4n0r commented 9 months ago

Both this issue and #1746 are pending to be reviewed by the design team.

For now, I am removing the stale label to prevent it from closing.

Sorry for the inconvenience.

github-actions[bot] commented 8 months ago

This issue is stale because it has been open for 15 days with no activity. If there are no further updates or modifications within the next 15 days, it will be automatically closed.

GomezIvann commented 6 months ago

Hello again @AlanPadi95!

I'm going to answer both requests:

  1. Disable option. We consider that this option does not make sense as it is not user-friendly to show an option in the menu when the user cannot interact with it. If this is the case, we recommend that it not be shown.
  2. Prioritised options. At the moment we consider all the options in a dropdown menu at the same level, with no degrees of priority between them. It is more of a navigational or action group in which every option has the same importance.