24 lines
817 B
JavaScript
Raw Normal View History

2018-05-03 01:27:44 +03:00
import { document, setTimeout } from 'global';
import { storiesOf } from '@storybook/html';
2018-12-18 10:59:29 +01:00
import { withA11Y } from '@storybook/addon-a11y';
2018-05-03 01:27:44 +03:00
const text = 'Testing the a11y addon';
storiesOf('Addons|a11y', module)
2018-12-18 10:59:29 +01:00
.addDecorator(withA11Y)
Merge branch 'next' into tech/overhaul-ui # Conflicts: # .babelrc.js # addons/a11y/package.json # addons/actions/package.json # addons/backgrounds/package.json # addons/cssresources/package.json # addons/events/package.json # addons/graphql/package.json # addons/info/package.json # addons/info/src/components/PropTable.js # addons/jest/package.json # addons/knobs/package.json # addons/links/package.json # addons/notes/package.json # addons/ondevice-backgrounds/package.json # addons/options/package.json # addons/storyshots/storyshots-core/package.json # addons/storyshots/storyshots-puppeteer/package.json # addons/storysource/package.json # app/angular/package.json # app/ember/package.json # app/html/package.json # app/marko/package.json # app/mithril/package.json # app/polymer/package.json # app/react/package.json # app/riot/package.json # app/svelte/package.json # app/vue/package.json # examples/official-storybook/stories/addon-a11y.stories.js # examples/official-storybook/stories/addon-actions.stories.js # lib/addons/package.json # lib/channel-postmessage/package.json # lib/channel-websocket/package.json # lib/components/package.json # lib/components/src/layout/mobile.js # lib/core/package.json # lib/core/src/server/common/babel.js # lib/ui/package.json # lib/ui/src/modules/ui/components/stories_panel/index.js # lib/ui/src/modules/ui/components/stories_panel/stories_tree/index.test.js # lib/ui/src/modules/ui/components/stories_panel/stories_tree/tree_decorators_utils.js # lib/ui/src/modules/ui/components/stories_panel/text_filter.js # yarn.lock
2018-12-06 16:49:52 +01:00
.addParameters({ options: { selectedAddonPanel: 'storybook/a11y/panel' } })
2018-05-03 01:27:44 +03:00
.add('Default', () => `<button></button>`)
.add('Label', () => `<button>${text}</button>`)
.add('Disabled', () => `<button disabled>${text}</button>`)
.add(
'Invalid contrast',
() => `<button style="color: black; background-color: brown;">${text}</button>`
)
.add('Delayed render', () => {
const div = document.createElement('div');
setTimeout(() => {
div.innerHTML = `<button>This button has a delayed render of 1s</button>`;
}, 1000);
return div;
});