preview.ts 807 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import type { Preview } from '@storybook/sveltekit';
  2. import '../src/app.css';
  3. import ModeWatcherDecorator from './ModeWatcherDecorator.svelte';
  4. import TooltipProviderDecorator from './TooltipProviderDecorator.svelte';
  5. const preview: Preview = {
  6. parameters: {
  7. controls: {
  8. matchers: {
  9. color: /(background|color)$/i,
  10. date: /Date$/i
  11. }
  12. },
  13. backgrounds: {
  14. disable: true
  15. },
  16. a11y: {
  17. // 'todo' - show a11y violations in the test UI only
  18. // 'error' - fail CI on a11y violations
  19. // 'off' - skip a11y checks entirely
  20. test: 'todo'
  21. }
  22. },
  23. decorators: [
  24. (story) => ({
  25. Component: ModeWatcherDecorator,
  26. props: {
  27. children: story
  28. }
  29. }),
  30. (story) => ({
  31. Component: TooltipProviderDecorator,
  32. props: {
  33. children: story
  34. }
  35. })
  36. ]
  37. };
  38. export default preview;