generated from storybookjs/addon-kit
-
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.
chore(deps): update to storybook 6.4
- Loading branch information
1 parent
5a936d8
commit 1341a9a
Showing
13 changed files
with
2,637 additions
and
2,704 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 |
---|---|---|
@@ -1,19 +1,19 @@ | ||
module.exports = { | ||
presets: [ | ||
"@babel/preset-env", | ||
"@babel/preset-typescript", | ||
"@babel/preset-react", | ||
], | ||
env: { | ||
esm: { | ||
presets: [ | ||
[ | ||
"@babel/preset-env", | ||
{ | ||
modules: false, | ||
}, | ||
], | ||
], | ||
presets: [ | ||
'@babel/preset-env', | ||
'@babel/preset-typescript', | ||
'@babel/preset-react', | ||
], | ||
env: { | ||
esm: { | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
modules: false, | ||
}, | ||
], | ||
], | ||
}, | ||
}, | ||
}, | ||
}; |
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 |
---|---|---|
|
@@ -5,3 +5,4 @@ build-storybook.log | |
.DS_Store | ||
.env | ||
.idea | ||
|
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 |
---|---|---|
@@ -1 +1,5 @@ | ||
{} | ||
{ | ||
"bracketSpacing": false, | ||
"singleQuote": true, | ||
"tabWidth": 4 | ||
} |
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
module.exports = { | ||
stories: [ | ||
"../stories/**/*.stories.mdx", | ||
"../stories/**/*.stories.@(js|jsx|ts|tsx)", | ||
], | ||
addons: ["../preset.js", "@storybook/addon-essentials"], | ||
stories: [ | ||
'../stories/**/*.stories.mdx', | ||
'../stories/**/*.stories.@(js|jsx|ts|tsx)', | ||
], | ||
addons: ['../preset.js', '@storybook/addon-essentials'], | ||
}; |
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 |
---|---|---|
@@ -1,16 +1,16 @@ | ||
function config(entry = []) { | ||
return [ | ||
...entry, | ||
require.resolve('storybook-i18n/preview'), | ||
require.resolve('./dist/esm/preset/preview'), | ||
]; | ||
return [ | ||
...entry, | ||
require.resolve('storybook-i18n/preview'), | ||
require.resolve('./dist/esm/preset/preview'), | ||
]; | ||
} | ||
|
||
function managerEntries(entry = []) { | ||
return [...entry, require.resolve('storybook-i18n/manager')]; | ||
return [...entry, require.resolve('storybook-i18n/manager')]; | ||
} | ||
|
||
module.exports = { | ||
config, | ||
managerEntries, | ||
config, | ||
managerEntries, | ||
}; |
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,3 @@ | ||
import {withReactIntl} from '../withReactIntl'; | ||
|
||
export const decorators = [withReactIntl]; |
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 |
---|---|---|
@@ -1 +1 @@ | ||
declare module "global"; | ||
declare module 'global'; |
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,38 @@ | ||
import React from 'react'; | ||
import { | ||
AnyFramework, | ||
PartialStoryFn as StoryFunction, | ||
StoryContext, | ||
} from '@storybook/csf'; | ||
import {IntlProvider} from 'react-intl'; | ||
import {useGlobals} from '@storybook/client-api'; | ||
|
||
export const withReactIntl = ( | ||
story: StoryFunction<AnyFramework>, | ||
context: StoryContext | ||
) => { | ||
const [{locale}] = useGlobals(); | ||
const { | ||
parameters: {reactIntl, locale: defaultLocale}, | ||
} = context; | ||
const currentLocale = locale || defaultLocale; | ||
|
||
if (currentLocale && reactIntl) { | ||
const {formats, messages} = reactIntl; | ||
const safeFormats = formats ? formats[currentLocale] : undefined; | ||
if (messages) { | ||
return ( | ||
<IntlProvider | ||
key={locale} | ||
formats={safeFormats} | ||
messages={messages[currentLocale]} | ||
locale={currentLocale} | ||
defaultLocale={defaultLocale} | ||
> | ||
{story(context)} | ||
</IntlProvider> | ||
); | ||
} | ||
} | ||
return story(context); | ||
}; |
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 |
---|---|---|
|
@@ -18,4 +18,4 @@ | |
"include": [ | ||
"src/**/*" | ||
], | ||
} | ||
} |
Oops, something went wrong.