Skip to content

Commit 6df1457

Browse files
committed
feat: up storybook to @8
1 parent bbd84f7 commit 6df1457

File tree

6 files changed

+2193
-6927
lines changed

6 files changed

+2193
-6927
lines changed
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
import {addons, } from '@storybook/addons';
1+
import {addons} from '@storybook/manager-api';
22

33
addons.register('initialFocus', () => {
44
addons.getChannel().on('currentStoryWasSet', () => focusIframe());
5-
})
5+
});
66

77
const focusIframe = () => {
8-
const previewIframe: HTMLInputElement | null = document.querySelector('#storybook-preview-iframe');
8+
const previewIframe: HTMLInputElement | null = document.querySelector(
9+
'#storybook-preview-iframe',
10+
);
911

1012
previewIframe?.focus?.();
11-
}
13+
};

.storybook/main.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type {StorybookConfig} from '@storybook/react-webpack5';
33
const config: StorybookConfig = {
44
staticDirs: ['./assets'],
55
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(ts|tsx)'],
6+
67
addons: [
78
'@storybook/addon-links',
89
{name: '@storybook/addon-essentials', options: {backgrounds: false}},
@@ -12,17 +13,24 @@ const config: StorybookConfig = {
1213
'./theme-addon/register.tsx',
1314
'./focus-addon/register.tsx',
1415
'@storybook/addon-a11y',
16+
'@storybook/addon-webpack5-compiler-babel',
17+
'@chromatic-com/storybook'
1518
],
19+
1620
framework: {
1721
name: '@storybook/react-webpack5',
1822
options: {}
1923
},
20-
docs: {
21-
autodocs: false,
22-
},
24+
25+
docs: {},
26+
2327
core: {
2428
disableTelemetry: true,
2529
},
30+
31+
typescript: {
32+
reactDocgen: 'react-docgen-typescript'
33+
}
2634
};
2735

2836
export default config;

.storybook/manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {addons} from '@storybook/addons';
1+
import {addons} from '@storybook/manager-api';
22
import {themes} from './theme';
33

44
addons.setConfig({

.storybook/theme-addon/register.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
2-
import {addons, types} from '@storybook/addons';
3-
import {useGlobals, type API} from '@storybook/api';
2+
import {addons, types} from '@storybook/manager-api';
3+
import {useGlobals, type API} from '@storybook/manager-api';
44
import {getThemeType} from '@gravity-ui/uikit';
55
import {themes} from '../theme';
66

0 commit comments

Comments
 (0)