add types to storybook config
This commit is contained in:
parent
351e5fa750
commit
15b376905d
|
@ -1,15 +1,20 @@
|
|||
module.exports = {
|
||||
import { StorybookConfig } from '@storybook/types'
|
||||
|
||||
const config: StorybookConfig = {
|
||||
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
|
||||
addons: [
|
||||
'@storybook/addon-links',
|
||||
'@storybook/addon-essentials',
|
||||
'@storybook/addon-interactions'
|
||||
'@storybook/addon-interactions',
|
||||
'storybook-addon-designs',
|
||||
],
|
||||
framework: {
|
||||
name: '@storybook/react-vite',
|
||||
options: {}
|
||||
options: {},
|
||||
},
|
||||
docs: {
|
||||
autodocs: 'tag'
|
||||
}
|
||||
autodocs: 'tag',
|
||||
},
|
||||
}
|
||||
|
||||
export default config
|
||||
|
|
|
@ -1,18 +1,19 @@
|
|||
import React from 'react'
|
||||
import { TamaguiProvider } from '@tamagui/core'
|
||||
import { config } from '../src'
|
||||
import { Parameters, Decorator } from '@storybook/react'
|
||||
|
||||
export const parameters = {
|
||||
export const parameters: Parameters = {
|
||||
actions: { argTypesRegex: '^on[A-Z].*' },
|
||||
controls: {
|
||||
matchers: {
|
||||
color: /(background|color)$/i,
|
||||
date: /Date$/
|
||||
}
|
||||
}
|
||||
date: /Date$/,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
const withThemeProvider = (Story, context) => {
|
||||
const withThemeProvider: Decorator = (Story, _context) => {
|
||||
return (
|
||||
<TamaguiProvider config={config}>
|
||||
<Story />
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0",
|
||||
"storybook": "^7.0.0-beta.21",
|
||||
"storybook-addon-designs": "^7.0.0-beta.2",
|
||||
"vite": "^4.0.4"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue