-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19114 from storybookjs/norbert/sb-574-addon-a11y
Addon-a11y: Move stories into addon
- Loading branch information
Showing
28 changed files
with
181 additions
and
436 deletions.
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
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.Html, | ||
args: { | ||
contents: '<button>Click Me!</button>', | ||
}, | ||
parameters: { | ||
chromatic: { disable: true }, | ||
}, | ||
}; | ||
|
||
export const Options = { | ||
args: { | ||
contents: | ||
'<button style="color: rgb(255, 255, 255); background-color: rgb(76, 175, 80);">Click me!</button>', | ||
}, | ||
parameters: { | ||
a11y: { | ||
config: {}, | ||
options: { | ||
checks: { | ||
'color-contrast': { enabled: false }, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export const Config = { | ||
args: { | ||
contents: | ||
'<button style="color: rgb(255, 255, 255); background-color: rgb(76, 175, 80);">Click me!</button>', | ||
}, | ||
parameters: { | ||
a11y: { | ||
config: { | ||
rules: [{ id: 'avoid-inline-spacing', options: {} }], | ||
disableOtherRules: true, | ||
}, | ||
options: {}, | ||
}, | ||
}, | ||
}; | ||
|
||
export const Targetted = { | ||
args: { | ||
contents: '<button class="custom-target">Click Me!</button>', | ||
}, | ||
parameters: { | ||
a11y: { | ||
element: '.custom-target', | ||
}, | ||
}, | ||
}; | ||
|
||
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: { | ||
contents: '', | ||
}, | ||
parameters: { | ||
chromatic: { disable: true }, | ||
}, | ||
}; | ||
|
||
export const Violations = { | ||
args: { | ||
contents: ` | ||
<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: { | ||
contents: ` | ||
<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.
Oops, something went wrong.