-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #182 from thoughtindustries/CLM-7570-convert-story…
…book-to-storybook-3 Upgrade Story Component Format
- Loading branch information
Showing
33 changed files
with
27,354 additions
and
49,597 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"sourceType": "unambiguous", | ||
"presets": [ | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
"targets": { | ||
"chrome": 100 | ||
} | ||
} | ||
], | ||
"@babel/preset-typescript", | ||
"@babel/preset-react" | ||
], | ||
"plugins": [] | ||
} |
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 was deleted.
Oops, something went wrong.
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,16 @@ | ||
import type { StorybookConfig } from '@storybook/types'; | ||
const config: StorybookConfig = { | ||
stories: ['../packages/'], | ||
staticDirs: ['./public'], | ||
addons: [ | ||
'@storybook/addon-links', | ||
'@storybook/addon-controls', | ||
'storybook-addon-apollo-client', | ||
'@storybook/addon-toolbars' | ||
], | ||
framework: '@storybook/react-vite', | ||
docs: { | ||
autodocs: true | ||
} | ||
}; | ||
export default config; |
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 @@ | ||
<link rel="favicon" href="/favicon.ico"> |
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,6 @@ | ||
import { addons } from '@storybook/manager-api'; | ||
import theme from './theme'; | ||
|
||
addons.setConfig({ | ||
theme: theme | ||
}); |
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,55 @@ | ||
import React, { Suspense, useEffect } from 'react'; | ||
import { I18nextProvider } from 'react-i18next'; | ||
import './style.css'; | ||
import { MockedProvider } from '@apollo/client/testing'; | ||
import { i18n } from '../i18n/i18n'; | ||
import { cookieDecorator } from 'storybook-addon-cookie'; | ||
|
||
export const parameters = { | ||
actions: { argTypesRegex: '^on[A-Z].*' }, | ||
controls: { | ||
matchers: { | ||
color: /(background|color)$/i, | ||
date: /Date$/ | ||
} | ||
}, | ||
apolloClient: { | ||
MockedProvider | ||
}, | ||
i18n, | ||
locale: 'en' | ||
}; | ||
|
||
const withI18next = (Story, context) => { | ||
const { locale } = context.globals; | ||
|
||
useEffect(() => { | ||
i18n.changeLanguage(locale); | ||
}, [locale]); | ||
return ( | ||
<Suspense fallback={<div>loading translations...</div>}> | ||
<I18nextProvider i18n={i18n}> | ||
<Story /> | ||
</I18nextProvider> | ||
</Suspense> | ||
); | ||
}; | ||
|
||
export const globalTypes = { | ||
locale: { | ||
name: 'Locale', | ||
description: 'Internationalization locale', | ||
defaultValue: 'en', | ||
toolbar: { | ||
icon: 'globe', | ||
items: [{ value: 'en', right: '🇺🇸', title: 'English' }] | ||
} | ||
}, | ||
['addon-apolloClient/queries']: { | ||
name: 'Apollo client addon queries', | ||
description: 'Apollo client addon queries', | ||
defaultValue: [] | ||
} | ||
}; | ||
|
||
export const decorators = [cookieDecorator, withI18next]; |
Binary file not shown.
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,8 @@ | ||
import { create } from '@storybook/theming'; | ||
|
||
export default create({ | ||
base: 'light', | ||
brandTitle: 'Thought Industries', | ||
brandUrl: 'https://developer.thoughtindustries.com/', | ||
brandTarget: '_self' | ||
}); |
Oops, something went wrong.