-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Addon-a11y: Move stories into addon #19114
Merged
Merged
Changes from 12 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
4ad0d79
move all a11y stories to be renderer agnostic into addons/a11y/templa…
ndelangen 3c7b4ee
fix cypress e2e test on official storybook
ndelangen 0b3ed22
Merge branch 'next' into norbert/sb-574-addon-a11y
ndelangen 982db83
add a Html component for testing any html content
ndelangen fb15a57
add stories to test axe through the a11y addon
ndelangen d1cff3a
cleanup
ndelangen 659218c
Merge branch 'next' into norbert/sb-574-addon-a11y
ndelangen 36b2c66
Merge branch 'next' into norbert/sb-574-addon-a11y
ndelangen 1ea262f
add a11y to sadnboxes
ndelangen 385f610
Add a Svelte Html component
ndelangen 3c33ab0
Add a Html component for vue3
ndelangen 1b86bf7
Merge branch 'next' into norbert/sb-574-addon-a11y
ndelangen bc3bdee
refactor a bit, to improve tests
ndelangen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import globalThis from 'global'; | ||
|
||
export default { | ||
component: globalThis.Components.Button, | ||
args: { | ||
children: 'Click Me!', | ||
}, | ||
parameters: { | ||
chromatic: { disable: true }, | ||
}, | ||
}; | ||
|
||
export const Basic = {}; | ||
|
||
export const Violation = { | ||
args: { | ||
// empty on purpose to get a button with no text | ||
children: '', | ||
}, | ||
}; | ||
|
||
export const Checks = { | ||
parameters: { | ||
a11y: { | ||
config: {}, | ||
options: { | ||
checks: { | ||
'color-contrast': { options: { noScroll: true } }, | ||
}, | ||
restoreScroll: true, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export const Targetted = { | ||
parameters: { | ||
a11y: { | ||
element: 'button', | ||
}, | ||
}, | ||
}; | ||
|
||
export const Blank = { | ||
parameters: { | ||
a11y: { | ||
config: { | ||
disableOtherRules: true, | ||
// @ts-ignore | ||
rules: [], | ||
}, | ||
options: {}, | ||
}, | ||
}, | ||
}; | ||
|
||
export const Disabled = { | ||
parameters: { | ||
a11y: { | ||
disable: true, | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import globalThis from 'global'; | ||
|
||
export default { | ||
component: globalThis.Components.Html, | ||
args: { | ||
content: '', | ||
}, | ||
parameters: { | ||
chromatic: { disable: true }, | ||
}, | ||
}; | ||
|
||
export const Violations = { | ||
args: { | ||
content: ` | ||
<div> | ||
<p>empty heading</p> | ||
<h1></h1> | ||
</div> | ||
<div> | ||
<p>empty button</p> | ||
<button></button> | ||
</div> | ||
<div> | ||
<p>low contrast</p> | ||
<button style="color: rgb(255, 255, 255); background-color: rgb(76, 175, 80);">Click me!</button> | ||
</div> | ||
<div> | ||
<p>missing label</p> | ||
<label><input /></label> | ||
</div> | ||
<div> | ||
<p>missing alt</p> | ||
<img src="https://storybook.js.org/images/placeholders/350x150.png" /> | ||
</div> | ||
`, | ||
}, | ||
}; | ||
|
||
export const Passes = { | ||
args: { | ||
content: ` | ||
<div> | ||
<p>heading</p> | ||
<h1>heading 1</h1> | ||
</div> | ||
<div> | ||
<p>button</p> | ||
<button>Click me!</button> | ||
</div> | ||
<div> | ||
<p>contrast</p> | ||
<button style="color: rgb(255, 255, 255); background-color: rgb(0, 0, 0);">Click me!</button> | ||
</div> | ||
<div> | ||
<p>label</p> | ||
<label><span>label</span><input /></label> | ||
</div> | ||
<div> | ||
<p>alt</p> | ||
<img src="https://storybook.js.org/images/placeholders/350x150.png" alt="placeholder" /> | ||
</div> | ||
`, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 0 additions & 27 deletions
27
code/examples/html-kitchen-sink/stories/__snapshots__/addon-a11y.stories.storyshot
This file was deleted.
Oops, something went wrong.
27 changes: 0 additions & 27 deletions
27
code/examples/html-kitchen-sink/stories/addon-a11y.stories.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 0 additions & 30 deletions
30
code/examples/official-storybook/stories/addon-a11y/base-button.stories.js
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
code/examples/official-storybook/stories/addon-a11y/button.stories.js
This file was deleted.
Oops, something went wrong.
33 changes: 0 additions & 33 deletions
33
code/examples/official-storybook/stories/addon-a11y/form.stories.js
This file was deleted.
Oops, something went wrong.
56 changes: 0 additions & 56 deletions
56
code/examples/official-storybook/stories/addon-a11y/highlight.stories.js
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it obvious this is doing something? Would it be better to do these kind of things in the HTML-based story file?