From 1af4256a7c82eec0a6fe5df7ed52dec7c2d919f3 Mon Sep 17 00:00:00 2001 From: Ashley Harrison Date: Wed, 15 May 2024 16:50:24 +0100 Subject: [PATCH] Switch: Improve disabled active state (#87694) * add subtle active disabled state + fix story * make toggle disabled color when disabled * add icon in checked state * undo placement changes * readd positioning changes * remove extra css --- .../src/components/Switch/Switch.story.tsx | 4 +-- .../src/components/Switch/Switch.tsx | 28 +++++++++++-------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/packages/grafana-ui/src/components/Switch/Switch.story.tsx b/packages/grafana-ui/src/components/Switch/Switch.story.tsx index 76594e3272d..12bbef7d675 100644 --- a/packages/grafana-ui/src/components/Switch/Switch.story.tsx +++ b/packages/grafana-ui/src/components/Switch/Switch.story.tsx @@ -33,8 +33,8 @@ export const Controlled: StoryFn = (args) => {
- - + +
diff --git a/packages/grafana-ui/src/components/Switch/Switch.tsx b/packages/grafana-ui/src/components/Switch/Switch.tsx index 462d517cd9b..bee3ea4949f 100644 --- a/packages/grafana-ui/src/components/Switch/Switch.tsx +++ b/packages/grafana-ui/src/components/Switch/Switch.tsx @@ -6,6 +6,7 @@ import { GrafanaTheme2, deprecationWarning } from '@grafana/data'; import { useStyles2 } from '../../themes'; import { getFocusStyles, getMouseFocusStyles } from '../../themes/mixins'; +import { Icon } from '../Icon/Icon'; export interface Props extends Omit, 'value'> { value?: boolean; @@ -35,7 +36,9 @@ export const Switch = React.forwardRef( {...inputProps} ref={ref} /> -