2024-09-25 15:17:58 +00:00
|
|
|
import { dirname, join } from 'path'
|
2023-04-11 18:52:18 +00:00
|
|
|
import type { StorybookConfig } from '@storybook/react-vite'
|
2023-01-13 14:52:08 +00:00
|
|
|
|
2024-09-25 15:17:58 +00:00
|
|
|
import type {} from '@storybook/react'
|
|
|
|
|
|
|
|
declare module '@storybook/react' {
|
|
|
|
export interface Parameters {
|
|
|
|
backgrounds?: {
|
|
|
|
default: 'light' | 'dark'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-01-13 14:52:08 +00:00
|
|
|
const config: StorybookConfig = {
|
2024-09-25 15:17:58 +00:00
|
|
|
framework: getAbsolutePath('@storybook/react-vite'),
|
|
|
|
|
|
|
|
typescript: {
|
|
|
|
reactDocgen: false,
|
|
|
|
},
|
2023-04-11 18:52:18 +00:00
|
|
|
|
2024-09-25 15:17:58 +00:00
|
|
|
stories: [
|
|
|
|
// '../src/**/*.mdx',
|
|
|
|
'../src/**/*.stories.@(js|jsx|ts|tsx)',
|
|
|
|
],
|
2023-01-10 11:24:24 +00:00
|
|
|
addons: [
|
2024-09-25 15:17:58 +00:00
|
|
|
getAbsolutePath('@storybook/addon-links'),
|
|
|
|
getAbsolutePath('@storybook/addon-essentials'),
|
|
|
|
getAbsolutePath('@storybook/addon-interactions'),
|
|
|
|
getAbsolutePath('@storybook/addon-designs'),
|
2023-01-10 11:24:24 +00:00
|
|
|
],
|
2023-04-11 18:52:18 +00:00
|
|
|
|
2024-09-25 15:17:58 +00:00
|
|
|
// docs: {
|
|
|
|
// autodocs: 'tag',
|
|
|
|
// },
|
2023-01-10 11:24:24 +00:00
|
|
|
}
|
2023-01-13 14:52:08 +00:00
|
|
|
|
|
|
|
export default config
|
2024-09-25 15:17:58 +00:00
|
|
|
|
|
|
|
function getAbsolutePath(value: string): any {
|
|
|
|
return dirname(require.resolve(join(value, 'package.json')))
|
|
|
|
}
|