From 1fe3b0f08ecec651634840d3bd4a8aafa1b900e6 Mon Sep 17 00:00:00 2001 From: Andrew Holloway Date: Tue, 11 Jun 2024 17:23:06 -0500 Subject: [PATCH] fix: use aria-disabled when disabled prop is applied (#1987) - updated the snapshots - update treatments of disabled across components - update aria-disabled in snapshots --- src/components/Checkbox/Checkbox-v2.module.css | 4 ++-- src/components/Checkbox/Checkbox-v2.stories.tsx | 11 ----------- .../__snapshots__/Checkbox-v2.test.tsx.snap | 4 ++++ src/components/FieldLabel/FieldLabel.tsx | 15 ++++++++++----- src/components/FieldNote/FieldNote-v2.tsx | 7 ++++++- .../InputField/InputField-v2.stories.tsx | 6 ------ src/components/InputField/InputField-v2.tsx | 6 +++++- .../__snapshots__/InputField-v2.test.tsx.snap | 4 +++- src/components/Radio/Radio-v2.stories.tsx | 16 ---------------- .../Radio/__snapshots__/Radio-v2.test.tsx.snap | 2 ++ src/components/Select/Select-v2.stories.tsx | 6 ------ src/components/Select/Select-v2.tsx | 1 + .../__snapshots__/TextareaField-v2.test.tsx.snap | 1 + 13 files changed, 34 insertions(+), 49 deletions(-) diff --git a/src/components/Checkbox/Checkbox-v2.module.css b/src/components/Checkbox/Checkbox-v2.module.css index ffc1704e6..6aef72f0a 100644 --- a/src/components/Checkbox/Checkbox-v2.module.css +++ b/src/components/Checkbox/Checkbox-v2.module.css @@ -73,12 +73,12 @@ .checkbox__input:not(:checked):not(:indeterminate) { color: var(--eds-theme-color-border-utility-default-medium-emphasis); - &:hover { + &:not(:disabled):hover { color: var(--eds-theme-color-border-utility-default-medium-emphasis-hover); background-color: var(--eds-theme-color-background-utility-default-no-emphasis-hover); } - &:active { + &:not(:disabled):active { color: var(--eds-theme-color-border-utility-default-medium-emphasis-active); background-color: var(--eds-theme-color-background-utility-default-no-emphasis-active); } diff --git a/src/components/Checkbox/Checkbox-v2.stories.tsx b/src/components/Checkbox/Checkbox-v2.stories.tsx index e55e1459e..a223e304f 100644 --- a/src/components/Checkbox/Checkbox-v2.stories.tsx +++ b/src/components/Checkbox/Checkbox-v2.stories.tsx @@ -7,7 +7,6 @@ const meta: Meta = { title: 'Components/V2/Checkbox', component: Checkbox, args: { - disabled: false, label: 'Checkbox', }, parameters: { @@ -59,11 +58,6 @@ export const Disabled: Story = { ), - parameters: { - axe: { - disabledRules: ['color-contrast'], - }, - }, }; /** @@ -84,9 +78,4 @@ export const LongLabels: Story = { args: { label: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit', }, - parameters: { - axe: { - disabledRules: ['color-contrast'], - }, - }, }; diff --git a/src/components/Checkbox/__snapshots__/Checkbox-v2.test.tsx.snap b/src/components/Checkbox/__snapshots__/Checkbox-v2.test.tsx.snap index 6bc10871d..a2f69fb6c 100644 --- a/src/components/Checkbox/__snapshots__/Checkbox-v2.test.tsx.snap +++ b/src/components/Checkbox/__snapshots__/Checkbox-v2.test.tsx.snap @@ -73,6 +73,7 @@ exports[` Disabled story renders snapshot 1`] = ` class="checkbox__labels" >