preview.tsx 814 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import React from 'react'
  2. import type { Preview } from '@storybook/react'
  3. import { withThemeByDataAttribute } from '@storybook/addon-themes';
  4. import I18nServer from '../app/components/i18n-server'
  5. import '../app/styles/globals.css'
  6. import '../app/styles/markdown.scss'
  7. import './storybook.css'
  8. export const decorators = [
  9. withThemeByDataAttribute({
  10. themes: {
  11. light: 'light',
  12. dark: 'dark',
  13. },
  14. defaultTheme: 'light',
  15. attributeName: 'data-theme',
  16. }),
  17. Story => {
  18. return <I18nServer>
  19. <Story />
  20. </I18nServer>
  21. }
  22. ];
  23. const preview: Preview = {
  24. parameters: {
  25. controls: {
  26. matchers: {
  27. color: /(background|color)$/i,
  28. date: /Date$/i,
  29. },
  30. },
  31. },
  32. }
  33. export default preview