Move stories to CSF Next
Signed-off-by: Charles de Dreuille <charles.dedreuille@gmail.com>
This commit is contained in:
+12
-4
@@ -1,8 +1,13 @@
|
||||
import addonA11y from '@storybook/addon-a11y';
|
||||
import addonDocs from '@storybook/addon-docs';
|
||||
import addonThemes from '@storybook/addon-themes';
|
||||
import addonLinks from '@storybook/addon-links';
|
||||
import { definePreview } from '@storybook/react-vite';
|
||||
import React, { useEffect } from 'react';
|
||||
import { TestApiProvider } from '@backstage/test-utils';
|
||||
import { Content, AlertDisplay } from '@backstage/core-components';
|
||||
import { apis } from './support/apis';
|
||||
import type { Decorator, Preview } from '@storybook/react-vite';
|
||||
import type { Decorator } from '@storybook/react-vite';
|
||||
import { useGlobals } from 'storybook/preview-api';
|
||||
import { UnifiedThemeProvider, themes } from '@backstage/theme';
|
||||
import { allModes } from './modes';
|
||||
@@ -16,7 +21,7 @@ import './storybook.css';
|
||||
// Custom themes
|
||||
import './themes/spotify.css';
|
||||
|
||||
const preview: Preview = {
|
||||
export default definePreview({
|
||||
globalTypes: {
|
||||
themeMode: {
|
||||
name: 'Theme Mode',
|
||||
@@ -47,10 +52,12 @@ const preview: Preview = {
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
initialGlobals: {
|
||||
themeMode: 'light',
|
||||
themeName: 'backstage',
|
||||
},
|
||||
|
||||
parameters: {
|
||||
layout: 'fullscreen',
|
||||
|
||||
@@ -102,6 +109,7 @@ const preview: Preview = {
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
decorators: [
|
||||
Story => {
|
||||
const [globals] = useGlobals();
|
||||
@@ -140,6 +148,6 @@ const preview: Preview = {
|
||||
);
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default preview;
|
||||
addons: [addonLinks(), addonThemes(), addonDocs(), addonA11y()],
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user