Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
chore(deps): update storybook monorepo to v5.3.18
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfelton committed Apr 9, 2020
1 parent 1e21e7e commit 83e65e0
Show file tree
Hide file tree
Showing 6 changed files with 273 additions and 1,025 deletions.
6 changes: 0 additions & 6 deletions .storybook/addons.js

This file was deleted.

10 changes: 10 additions & 0 deletions .storybook/main.js
@@ -0,0 +1,10 @@
module.exports = {
stories: ['../**/*.stories.js'],
addons: [
'@storybook/addon-actions',
'@storybook/addon-links',
'@storybook/addon-knobs',
'storybook-addon-intl',
'storybook-styled-components',
],
}
9 changes: 9 additions & 0 deletions .storybook/manager.js
@@ -0,0 +1,9 @@
import { addons } from '@storybook/addons'
import { themes } from '@storybook/theming'

addons.setConfig({
brandTitle: 'Zap',
brandUrl: 'https://ln-zap.github.io/zap-desktop',
theme: themes.dark,
hierarchySeparator: /\./,
})
38 changes: 8 additions & 30 deletions .storybook/config.js → .storybook/preview.js
Expand Up @@ -2,35 +2,34 @@ import React from 'react'
import { addParameters, addDecorator, configure, setAddon } from '@storybook/react'
import { withThemes } from 'storybook-styled-components'
import { withTheme } from 'styled-components'
import { themes } from '@storybook/theming'
import chaptersAddon, { setDefaults } from 'react-storybook-addon-chapters'
import { withConsole } from '@storybook/addon-console'
import { withKnobs } from '@storybook/addon-knobs'
import { linkTo } from '@storybook/addon-links'
import { setIntlConfig, withIntl } from 'storybook-addon-intl'
import StoryRouter from 'storybook-react-router'
import { dark, light } from 'themes'
import { getDefaultLocale, locales } from '@zap/i18n'
import { BackgroundPrimary, GlobalStyle } from 'components/UI'
import '@storybook/addon-console'

// Get translations.
import translations from '@zap/i18n/translation'

const BackgroundPrimaryWithTheme = withTheme(({ theme, ...rest }) => (
<BackgroundPrimary
className={theme.name}
p={3}
height="100vh"
p={3}
sx={{
overflowY: 'auto !important',
}}
{...rest}
/>
))

// Get translations.
import translations from '@zap/i18n/translation'

// Set intl configuration
setIntlConfig({
locales: locales,
locales,
defaultLocale: getDefaultLocale(),
getMessages: locale => translations[locale],
})
Expand All @@ -41,28 +40,15 @@ addDecorator(withIntl)
// Router
addDecorator(StoryRouter({}))

// Console.
addDecorator((storyFn, context) => withConsole()(storyFn)(context))

// Knobs
addDecorator(withKnobs)

// Options
addParameters({
options: {
brandTitle: 'Zap',
brandUrl: 'https://ln-zap.github.io/zap-desktop',
theme: themes.dark,
hierarchySeparator: /\./,
},
})

// Zap Global style.
addDecorator(story => (
<React.Fragment>
<>
<GlobalStyle />
<BackgroundPrimaryWithTheme>{story()}</BackgroundPrimaryWithTheme>
</React.Fragment>
</>
))

// Zap Themes.
Expand All @@ -79,11 +65,3 @@ setDefaults({
allowPropTablesToggling: true,
},
})

// automatically import all files ending in *.stories.js
const req = require.context('../stories', true, /.stories.js$/)
function loadStories() {
req.keys().forEach(filename => req(filename))
}

configure(loadStories, module)
14 changes: 7 additions & 7 deletions package.json
Expand Up @@ -221,14 +221,14 @@
"@commitlint/config-conventional": "8.3.4",
"@ln-zap/eslint-config": "0.3.2",
"@ln-zap/prettier-config": "0.1.0",
"@storybook/addon-actions": "5.2.8",
"@storybook/addon-actions": "5.3.18",
"@storybook/addon-console": "1.2.1",
"@storybook/addon-knobs": "5.2.8",
"@storybook/addon-links": "5.2.8",
"@storybook/addons": "5.2.8",
"@storybook/components": "5.2.8",
"@storybook/react": "5.2.8",
"@storybook/source-loader": "5.2.8",
"@storybook/addon-knobs": "5.3.18",
"@storybook/addon-links": "5.3.18",
"@storybook/addons": "5.3.18",
"@storybook/components": "5.3.18",
"@storybook/react": "5.3.18",
"@storybook/source-loader": "5.3.18",
"@svgr/cli": "4.3.3",
"add-asset-html-webpack-plugin": "3.1.3",
"babel-core": "7.0.0-bridge.0",
Expand Down

0 comments on commit 83e65e0

Please sign in to comment.