From cfccb2ee989c41b39b0e1ff6ecb9a8dcb01cf5e0 Mon Sep 17 00:00:00 2001 From: basilgood Date: Sat, 3 Aug 2024 11:50:47 +0300 Subject: [PATCH] chore: simplified config --- .storybook/main.js | 16 ++-------------- .storybook/preview.js | 5 +++++ stories/cosmoz-image-viewer.stories.js | 15 +++------------ 3 files changed, 10 insertions(+), 26 deletions(-) create mode 100644 .storybook/preview.js diff --git a/.storybook/main.js b/.storybook/main.js index 74cba82..1a0ca59 100644 --- a/.storybook/main.js +++ b/.storybook/main.js @@ -1,23 +1,11 @@ /** @type { import('@storybook/web-components-vite').StorybookConfig } */ -const config = { +export default { stories: ['../stories/**/*.stories.{js,ts,mdx}'], addons: ['@storybook/addon-essentials', '@storybook/addon-links'], core: { builder: '@storybook/builder-vite', disableTelemetry: true, }, - framework: { - name: '@storybook/web-components-vite', - options: {}, - }, - docs: { - autodocs: true, - defaultName: 'Docs', - }, + framework: '@storybook/web-components-vite', staticDirs: ['../stories/images'], - async viteFinal(config) { - return config; - }, }; - -export default config; diff --git a/.storybook/preview.js b/.storybook/preview.js new file mode 100644 index 0000000..e5791e3 --- /dev/null +++ b/.storybook/preview.js @@ -0,0 +1,5 @@ +export default { + // ...rest of preview + //👇 Enables auto-generated documentation for all stories + tags: ['autodocs'], +}; diff --git a/stories/cosmoz-image-viewer.stories.js b/stories/cosmoz-image-viewer.stories.js index a68e0ee..de5f522 100644 --- a/stories/cosmoz-image-viewer.stories.js +++ b/stories/cosmoz-image-viewer.stories.js @@ -36,10 +36,7 @@ export const Basic = ({ ?loop=${loop} ?show-zoom=${showZoom} ?detached-show-zoom=${detachedShowZoom} - .images=${[ - 'cosmos1.jpg', - 'cosmos2.jpg', - ]} + .images=${['cosmos1.jpg', 'cosmos2.jpg']} > `; @@ -54,14 +51,8 @@ Basic.args = { }; export const Issue21 = () => { - const images1 = [ - 'stockholm.jpg', - 'strasbourg.jpg', - ], - images2 = [ - 'cosmos1.jpg', - 'cosmos2.jpg', - ]; + const images1 = ['stockholm.jpg', 'strasbourg.jpg'], + images2 = ['cosmos1.jpg', 'cosmos2.jpg']; return html`