-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Now using alpha storybook for emotion 11 support, which is required for MUI See mui/material-ui#24282 and storybookjs/storybook#17000
- Loading branch information
Showing
9 changed files
with
769 additions
and
712 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<link | ||
href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap" | ||
rel="stylesheet" | ||
/> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import "../styles/globals.css"; | ||
import { theme } from "../src/theme"; | ||
import { MuiProvider } from "../src/theme/MuiProvider"; | ||
|
||
export const decorators = [ | ||
(Story: any) => ( | ||
<MuiProvider theme={theme}> | ||
<Story /> | ||
</MuiProvider> | ||
), | ||
]; | ||
|
||
export const parameters = { | ||
actions: { argTypesRegex: "^on[A-Z].*" }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/, | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"extends": "../tsconfig.json", | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"jsx": "preserve" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { CacheProvider, EmotionCache } from "@emotion/react"; | ||
import { ThemeProvider } from "@mui/material"; | ||
import CssBaseline from "@mui/material/CssBaseline"; | ||
import { ThemeProviderProps } from "@mui/material/styles/ThemeProvider"; | ||
import { FC } from "react"; | ||
import { createEmotionCache } from "../util/createEmotionCache"; | ||
|
||
const clientSideEmotionCache = createEmotionCache(); | ||
|
||
export const MuiProvider: FC<{ | ||
emotionCache?: EmotionCache; | ||
theme: ThemeProviderProps["theme"]; | ||
}> = ({ children, theme, emotionCache = clientSideEmotionCache }) => { | ||
return ( | ||
<CacheProvider value={emotionCache}> | ||
<ThemeProvider theme={theme}> | ||
<CssBaseline /> | ||
{children} | ||
</ThemeProvider> | ||
</CacheProvider> | ||
); | ||
}; |
Oops, something went wrong.