grafana-ui: Style disabled option for Select (#41464)

This commit is contained in:
Alex Khomenko 2021-11-09 17:00:08 +02:00 committed by GitHub
parent f6545ab8f4
commit 8d22733666
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View File

@ -47,7 +47,12 @@ export const SelectMenuOptions = React.forwardRef<HTMLDivElement, React.PropsWit
return (
<div
ref={ref}
className={cx(styles.option, isFocused && styles.optionFocused, isSelected && styles.optionSelected)}
className={cx(
styles.option,
isFocused && styles.optionFocused,
isSelected && styles.optionSelected,
data.isDisabled && styles.optionDisabled
)}
{...innerProps}
aria-label="Select option"
>

View File

@ -57,6 +57,12 @@ export const getSelectStyles = stylesFactory((theme: GrafanaTheme2) => {
optionSelected: css`
background: ${theme.colors.action.selected};
`,
optionDisabled: css`
label: grafana-select-option-disabled;
background-color: ${theme.colors.action.disabledBackground};
color: ${theme.colors.action.disabledText};
cursor: not-allowed;
`,
singleValue: css`
label: grafana-select-single-value;
color: ${theme.components.input.text};