This commit is contained in:
Norbert de Langen 2024-07-24 17:33:07 +02:00
parent 301af1c18f
commit 88ab1a2381
4 changed files with 24 additions and 50 deletions

View File

@ -19,7 +19,6 @@ import { DocsContext } from '@storybook/blocks';
import { MINIMAL_VIEWPORTS } from '@storybook/addon-viewport';
import { DocsPageWrapper } from '../lib/blocks/src/components';
import type { GlobalTypes } from '@storybook/csf';
const { document } = global;
@ -313,25 +312,8 @@ export const parameters = {
},
};
// export const globalTypes = {
// viewport: {
// options: MINIMAL_VIEWPORTS,
// },
// backgrounds: {
// options: {
// light: { name: 'light', value: '#f7f7f7' },
// dark: { name: 'dark', value: '#333' },
// },
// grid: {
// cellSize: 15,
// cellAmount: 10,
// opacity: 0.8,
// },
// },
// } satisfies GlobalTypes;
export const initialGlobals = {
// theme: 'light',
// viewport: { value: 'mobile1', isRotated: false },
// backgrounds: { value: 'dark', grid: false },
} as const;
// export const initialGlobals = {
// theme: 'light',
// viewport: { value: 'mobile1', isRotated: false },
// backgrounds: { value: 'dark', grid: false },
// } as const;

View File

@ -1,49 +1,41 @@
import type { Addon_DecoratorFunction } from 'storybook/internal/types';
import { withBackground } from './legacy/withBackgroundLegacy';
import { withGrid } from './legacy/withGridLegacy';
import { PARAM_KEY } from './constants';
import { PARAM_KEY as KEY } from './constants';
import { withBackgroundAndGrid } from './decorator';
export const decorators: Addon_DecoratorFunction[] = FEATURES?.backgroundsStoryGlobals
? [withBackgroundAndGrid]
: [withGrid, withBackground];
// TODO: remove in 9.0
export const parameters = {
[PARAM_KEY]: {
[KEY]: {
grid: {
cellSize: 20,
opacity: 0.5,
cellAmount: 5,
},
values: [
{ name: 'light', value: '#F8F8F8' },
{ name: 'dark', value: '#333333' },
],
...(FEATURES?.backgroundsStoryGlobals
? {
options: {
light: { name: 'light', value: '#F8F8F8' },
dark: { name: 'dark', value: '#333' },
},
}
: {
// TODO: remove in 9.0
values: [
{ name: 'light', value: '#F8F8F8' },
{ name: 'dark', value: '#333333' },
],
}),
},
};
// // TODO: remove feature flag in 9.0
// export const globalTypes = FEATURES?.backgroundsStoryGlobals
// ? {
// [PARAM_KEY]: {
// grid: {
// cellSize: 20,
// opacity: 0.5,
// cellAmount: 5,
// },
// values: [
// { name: 'light', value: '#F8F8F8' },
// { name: 'dark', value: '#333333' },
// ],
// },
// }
// : {};
export const globalTypes = {
[PARAM_KEY]: {},
[KEY]: {},
};
export const initialGlobals = {
[PARAM_KEY]: null as any,
[KEY]: null as any,
};

View File

@ -0,0 +1 @@
declare var FEATURES: import('storybook/internal/types').StorybookConfigRaw['features'];

View File

@ -69,7 +69,6 @@
},
"bundler": {
"exportEntries": [
"./src/models/index.ts",
"./src/index.ts"
],
"managerEntries": [