From 5f64ea371b960a4793ee4068878c991fbcdf626f Mon Sep 17 00:00:00 2001 From: Gavin King Date: Sun, 17 Jun 2018 06:44:55 +0200 Subject: [PATCH] Added background addon support --- ADDONS_SUPPORT.md | 2 +- addons/backgrounds/svelte.js | 1 + .../src/stories/addon-backgrounds.stories.js | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 addons/backgrounds/svelte.js create mode 100644 examples/svelte-kitchen-sink/src/stories/addon-backgrounds.stories.js diff --git a/ADDONS_SUPPORT.md b/ADDONS_SUPPORT.md index cfaf8cf38fb..f1cb2131bea 100644 --- a/ADDONS_SUPPORT.md +++ b/ADDONS_SUPPORT.md @@ -4,7 +4,7 @@ | ----------- |:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:|:-------:| |[a11y](addons/a11y) |+| |+|+|+|+|+|+| | |[actions](addons/actions) |+|+|+|+|+|+|+|+| | -|[backgrounds](addons/backgrounds) |+| |+|+|+|+|+|+| | +|[backgrounds](addons/backgrounds) |+| |+|+|+|+|+|+|+| |[centered](addons/centered) |+| |+|+| |+|+| |+| |[events](addons/events) |+| |+|+|+|+|+|+| | |[graphql](addons/graphql) |+| | | | | | | | | diff --git a/addons/backgrounds/svelte.js b/addons/backgrounds/svelte.js new file mode 100644 index 00000000000..c22c26b6732 --- /dev/null +++ b/addons/backgrounds/svelte.js @@ -0,0 +1 @@ +module.exports = require('./dist/deprecated'); diff --git a/examples/svelte-kitchen-sink/src/stories/addon-backgrounds.stories.js b/examples/svelte-kitchen-sink/src/stories/addon-backgrounds.stories.js new file mode 100644 index 00000000000..93cb7ef53d6 --- /dev/null +++ b/examples/svelte-kitchen-sink/src/stories/addon-backgrounds.stories.js @@ -0,0 +1,15 @@ +import { storiesOf } from '@storybook/svelte'; +import { withBackgrounds } from '@storybook/addon-backgrounds'; + +import ButtonView from './views/ButtonView.svelte'; + +storiesOf('Addon|Backgrounds', module) + .addDecorator( + withBackgrounds([ + { name: 'twitter', value: '#00aced' }, + { name: 'facebook', value: '#3b5998', default: true }, + ]) + ) + .add('story 1', () => ({ + Component: ButtonView, + }));