2026-01-05 14:43:19 +03:00
|
|
|
import type { Preview } from '@storybook/svelte-vite';
|
2026-01-18 19:25:07 +03:00
|
|
|
import StoryStage from './StoryStage.svelte';
|
2026-01-05 14:43:19 +03:00
|
|
|
import '../src/app/styles/app.css';
|
|
|
|
|
|
|
|
|
|
const preview: Preview = {
|
|
|
|
|
parameters: {
|
2026-01-18 19:25:07 +03:00
|
|
|
layout: 'fullscreen',
|
2026-01-05 14:43:19 +03:00
|
|
|
controls: {
|
|
|
|
|
matchers: {
|
|
|
|
|
color: /(background|color)$/i,
|
|
|
|
|
date: /Date$/i,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
a11y: {
|
|
|
|
|
// 'todo' - show a11y violations in the test UI only
|
|
|
|
|
// 'error' - fail CI on a11y violations
|
|
|
|
|
// 'off' - skip a11y checks entirely
|
|
|
|
|
test: 'todo',
|
|
|
|
|
},
|
|
|
|
|
},
|
2026-01-18 19:25:07 +03:00
|
|
|
decorators: [
|
|
|
|
|
(storyFn, { parameters }) => {
|
|
|
|
|
const { Component, props } = storyFn();
|
|
|
|
|
return {
|
|
|
|
|
Component: StoryStage,
|
|
|
|
|
// We pass the actual story component into the Stage via a snippet/slot
|
|
|
|
|
// Svelte 5 Storybook handles this mapping internally when you return this structure
|
|
|
|
|
props: {
|
|
|
|
|
children: Component,
|
|
|
|
|
width: parameters.stageWidth || 'max-w-3xl',
|
|
|
|
|
...props,
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
],
|
2026-01-05 14:43:19 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default preview;
|