opensearch-project / oui

OpenSearch UI Framework
Apache License 2.0
31 stars 65 forks source link

[Feature] OuiSplitButton - options - allow "disabled" #1195

Open pjfitzgibbons opened 6 months ago

pjfitzgibbons commented 6 months ago

Is your feature request related to a problem? Please describe. Recently released SplitButton has only "simple" options items - string or ReactNode.

I want to be able to have some option items displayed as "disabled" for cases where an item should be presented to the user, though not available for selection at this time / in this context.

Describe the solution you'd like

Extend Options items to be string | ReactNode | SplitButtonOption where :

interface SplitButtonOption {
  disabled?: boolean;
  value?: string;
  display: string | ReactNode
}

Describe alternatives you've considered OuiSuperSelect has "all the bells and whistles" for Options Items, though some of those features do not fit the context of SplitButton, like "inputDisplay" vs "dropdownDisplay". A simple extension of the existing type on SplitButton will do.

Additional context

Reference Issue #1187