-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: build storybook after build changes
- Loading branch information
Showing
30 changed files
with
2,986 additions
and
3,029 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,17 @@ | ||
{ | ||
"sourceType": "unambiguous", | ||
"presets": [ | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
"targets": { | ||
"chrome": 100, | ||
"node": "current" | ||
} | ||
} | ||
], | ||
"@babel/preset-typescript", | ||
"@babel/preset-react" | ||
], | ||
"plugins": [] | ||
} |
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,35 @@ | ||
const config = { | ||
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'], | ||
addons: [ | ||
'@storybook/addon-links', | ||
'@storybook/addon-essentials', | ||
'@storybook/addon-interactions', | ||
'storybook-addon-mock', | ||
], | ||
framework: { | ||
name: '@storybook/react-webpack5', | ||
options: {}, | ||
}, | ||
docs: { | ||
autodocs: 'tag', | ||
}, | ||
webpackFinal: async (config) => { | ||
if (config.module?.rules) { | ||
// This modifies the existing image rule to exclude .svg files | ||
// since you want to handle those files with @svgr/webpack | ||
const imageRule = config.module.rules.find((rule) => | ||
rule.test.test('.svg') | ||
); | ||
imageRule.exclude = /\.svg$/; | ||
|
||
// Configure .svg files to be loaded with @svgr/webpack | ||
config.module.rules.push({ | ||
test: /\.svg$/, | ||
use: ['@svgr/webpack'], | ||
}); | ||
} | ||
|
||
return config; | ||
}, | ||
}; | ||
export default config; |
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,15 @@ | ||
import type { Preview } from '@storybook/react'; | ||
|
||
const preview: Preview = { | ||
parameters: { | ||
actions: { argTypesRegex: '^on[A-Z].*' }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
export default preview; |
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
45 changes: 45 additions & 0 deletions
45
packages/react/src/GoogleLoginButton/GoogleLoginButton.stories.tsx
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,45 @@ | ||
import React from 'react'; | ||
import { CssVarsProvider } from '@mui/joy/styles'; | ||
|
||
import { NileProvider } from '../context'; | ||
import defaultTheme from '../context/themeJoiner'; | ||
|
||
import GoogleLoginButton from './GoogleLoginButton'; | ||
import GoogleSSOButton from './GoogleSSOButton'; | ||
|
||
const meta = { | ||
title: 'SSO/Google', | ||
component: GoogleLoginButton, | ||
tags: ['autodocs'], | ||
}; | ||
|
||
export default meta; | ||
|
||
export function Basic() { | ||
return ( | ||
<NileProvider database="database" workspace="my_workspace"> | ||
<div style={{ maxWidth: '20rem', margin: '0 auto' }}> | ||
<GoogleLoginButton /> | ||
</div> | ||
</NileProvider> | ||
); | ||
} | ||
export function AlphaVersionWithOutProvider() { | ||
return ( | ||
<CssVarsProvider theme={defaultTheme}> | ||
<div style={{ maxWidth: '20rem', margin: '0 auto' }}> | ||
<GoogleSSOButton href="some href" /> | ||
</div> | ||
</CssVarsProvider> | ||
); | ||
} | ||
|
||
export function AlphaVersionWithProvider() { | ||
return ( | ||
<NileProvider database="database" workspace="workspace"> | ||
<div style={{ maxWidth: '20rem', margin: '0 auto' }}> | ||
<GoogleSSOButton /> | ||
</div> | ||
</NileProvider> | ||
); | ||
} |
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,23 @@ | ||
import React from 'react'; | ||
import { Meta } from '@storybook/react'; | ||
import Stack from '@mui/joy/Stack'; | ||
|
||
import LoginForm from '../../src/LoginForm'; | ||
import { NileProvider } from '../../src/context'; | ||
|
||
const meta: Meta = { | ||
tags: ['autodocs'], | ||
component: LoginForm, | ||
}; | ||
|
||
export default meta; | ||
|
||
export function Basic() { | ||
return ( | ||
<NileProvider database="database" workspace="workspace"> | ||
<Stack sx={{ maxWidth: '20rem', margin: '0 auto' }} spacing={2}> | ||
<LoginForm onSuccess={() => alert('success!')} /> | ||
</Stack> | ||
</NileProvider> | ||
); | ||
} |
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,23 @@ | ||
import React from 'react'; | ||
import { Meta } from '@storybook/react'; | ||
|
||
import { NileProvider } from '../context'; | ||
|
||
import SignUpForm from '.'; | ||
|
||
const meta: Meta = { | ||
tags: ['autodocs'], | ||
component: SignUpForm, | ||
}; | ||
|
||
export default meta; | ||
|
||
export function Basic() { | ||
return ( | ||
<NileProvider workspace="workspace" database="database"> | ||
<div style={{ maxWidth: '20rem', margin: '0 auto' }}> | ||
<SignUpForm onSuccess={() => alert('success!')} /> | ||
</div> | ||
</NileProvider> | ||
); | ||
} |
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
Oops, something went wrong.