Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .storybook/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ const preview: Preview = {
{ id: 'landmark-one-main', enabled: false }, // not relevant to single components
{ id: 'page-has-heading-one', enabled: false }, // not relevant to single components
{ id: 'region', enabled: false }, // not relevant to single components
{ id: 'color-contrast', enabled: false }, // doesn't work with gradients
],
},
},
Expand Down
7 changes: 3 additions & 4 deletions .storybook/test-runner.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { TestRunnerConfig } from '@storybook/test-runner';
import { getStoryContext } from '@storybook/test-runner'
import { getStoryContext, waitForPageReady } from '@storybook/test-runner'
import { injectAxe, checkA11y, configureAxe } from 'axe-playwright';

const prepareA11y = async (page) => await injectAxe(page);
Expand Down Expand Up @@ -28,10 +28,9 @@ const executeA11y = async (page, context) => {
}

const config: TestRunnerConfig = {
async preVisit(page) {
await prepareA11y(page);
},
async postVisit(page, context) {
await waitForPageReady(page);
await prepareA11y(page);
await executeA11y(page, context);
},
};
Expand Down
3 changes: 2 additions & 1 deletion src/components/button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ const Button: React.FC<ButtonType> = (props) => {
const content = getContent(children, ButtonIcon)


return <a {...args} className={`button button--${variant} ${active ? "button--active" : ""} ${disabled ? "button--disabled" : ""}`}>
return <a {...args} className={`button button--${variant} ${active ? "button--active" : ""} ${disabled ? "button--disabled" : ""}`}
aria-disabled={disabled ? "true" : "false"}>
{icon}
{content ? <span className={"button__content"}>{content}</span> : null}
</a>
Expand Down
3 changes: 2 additions & 1 deletion src/components/input/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ const Input: React.FC<InputType> = (props: InputType) => {
const {disabled, children, valid} = props

return <div
className={`input ${disabled ? "input--disabled" : ""} ${valid ? "input--valid" : valid !== undefined ? "input--not-valid" : ""}`}>
className={`input ${disabled ? "input--disabled" : ""} ${valid ? "input--valid" : valid !== undefined ? "input--not-valid" : ""}`}
aria-disabled={disabled ? "true" : "false"}>
{children}
</div>
}
Expand Down