wikipedia-game-solver/apps/storybook/.storybook/preview.tsx

53 lines
1.3 KiB
TypeScript
Raw Normal View History

2024-07-24 12:35:33 +02:00
import "@repo/config-tailwind/styles.css"
2024-07-27 11:20:23 +02:00
import { defaultTranslationValues, Locale } from "@repo/i18n/config"
2024-07-24 12:35:33 +02:00
import i18nMessagesEnglish from "@repo/i18n/translations/en-US.json"
import type { Preview } from "@storybook/react"
import { NextIntlClientProvider } from "next-intl"
2024-07-31 15:46:01 +02:00
import { ThemeProvider as NextThemeProvider } from "next-themes"
2024-07-24 12:35:33 +02:00
import React from "react"
const preview: Preview = {
parameters: {
nextjs: {
appDirectory: true,
},
options: {
storySort: {
2024-07-31 15:46:01 +02:00
order: ["Design System", "Layout", "Errors"],
2024-07-24 12:35:33 +02:00
},
},
backgrounds: { disable: true },
darkMode: {
darkClass: "dark",
lightClass: "light",
classTarget: "html",
stylePreview: true,
},
controls: {
matchers: {
color: /(background|color)$/i,
date: /Date$/i,
},
},
},
decorators: [
(Story) => {
2024-07-27 11:20:23 +02:00
const locale = "en-US" satisfies Locale
2024-07-24 12:35:33 +02:00
return (
2024-07-31 15:46:01 +02:00
<NextThemeProvider enableColorScheme={false}>
2024-07-24 12:35:33 +02:00
<NextIntlClientProvider
messages={i18nMessagesEnglish}
2024-07-27 11:20:23 +02:00
locale={locale}
2024-07-24 12:35:33 +02:00
defaultTranslationValues={defaultTranslationValues}
>
<Story />
</NextIntlClientProvider>
2024-07-31 15:46:01 +02:00
</NextThemeProvider>
2024-07-24 12:35:33 +02:00
)
},
],
}
export default preview