diff --git a/packages/core/src/components/action-card/action-card.scss b/packages/core/src/components/action-card/action-card.scss index 4a22a1bff17..9ee8faafa80 100644 --- a/packages/core/src/components/action-card/action-card.scss +++ b/packages/core/src/components/action-card/action-card.scss @@ -15,14 +15,38 @@ width: 13.375rem; height: 7.5rem; min-height: 7.5rem; - cursor: pointer; margin: 0.25rem 0; @include component.ix-component; +} + +button.card-button { + all: unset; + display: block; + box-sizing: border-box; + width: 100%; + height: 100%; + cursor: pointer; ix-card { width: 100%; height: 100%; } + + &:focus-visible { + outline: var(--theme-focus-border-thickness) solid + var(--theme-color-focus-bdr); + outline-offset: var(--theme-focus-outline-offset); + border-radius: var(--theme-card--border-radius); + } + + :host(.passive) & { + pointer-events: none; + cursor: default; + } + + :host(:not(.passive)) &:active ix-card { + background-color: var(--theme-color-ghost--active); + } } diff --git a/packages/core/src/components/action-card/action-card.tsx b/packages/core/src/components/action-card/action-card.tsx index 775f3acf987..3c63415b2b9 100644 --- a/packages/core/src/components/action-card/action-card.tsx +++ b/packages/core/src/components/action-card/action-card.tsx @@ -75,48 +75,53 @@ export class IxActionCard { return ( - - - {this.icon ? ( - - ) : null} - - {this.heading ? ( - - {this.heading} - + + + {this.icon ? ( + ) : null} - {this.subheading ? ( - - {this.subheading} - - ) : null} - - - - + + {this.heading ? ( + + {this.heading} + + ) : null} + {this.subheading ? ( + + {this.subheading} + + ) : null} + + + + + ); } diff --git a/packages/core/src/components/action-card/test/action-card.ct.ts b/packages/core/src/components/action-card/test/action-card.ct.ts new file mode 100644 index 00000000000..c6d41d70843 --- /dev/null +++ b/packages/core/src/components/action-card/test/action-card.ct.ts @@ -0,0 +1,39 @@ +/* + * SPDX-FileCopyrightText: 2024 Siemens AG + * + * SPDX-License-Identifier: MIT + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ +import { expect } from '@playwright/test'; +import { regressionTest } from '@utils/test'; + +regressionTest.describe('accessibility', () => { + regressionTest('default', async ({ mount, makeAxeBuilder }) => { + await mount(` + + `); + + const accessibilityScanResults = await makeAxeBuilder().analyze(); + + expect(accessibilityScanResults.violations).toEqual([]); + }); + + regressionTest('passive', async ({ mount, makeAxeBuilder }) => { + await mount(` + + `); + + const accessibilityScanResults = await makeAxeBuilder().analyze(); + + expect(accessibilityScanResults.violations).toEqual([]); + }); +});