mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2025-07-27 08:30:02 +03:00
Update
This commit is contained in:
parent
79e47bcb3f
commit
0830be3e85
|
@ -1,14 +0,0 @@
|
||||||
import type { Preview } from '@storybook/react';
|
|
||||||
|
|
||||||
const preview: Preview = {
|
|
||||||
parameters: {
|
|
||||||
controls: {
|
|
||||||
matchers: {
|
|
||||||
color: /(background|color)$/i,
|
|
||||||
date: /Date$/i,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
export default preview;
|
|
60
packages/redux-devtools-ui/.storybook/preview.tsx
Normal file
60
packages/redux-devtools-ui/.storybook/preview.tsx
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
import React from 'react';
|
||||||
|
import type { Preview } from '@storybook/react';
|
||||||
|
|
||||||
|
import { Container } from '../src';
|
||||||
|
import { listSchemes, listThemes } from '../src/utils/theme';
|
||||||
|
|
||||||
|
const withThemeProvider = (Story, context) => (
|
||||||
|
<Container
|
||||||
|
themeData={{
|
||||||
|
theme: context.globals.theme,
|
||||||
|
scheme: context.globals.scheme,
|
||||||
|
colorPreference: context.globals.color,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Story {...context} />
|
||||||
|
</Container>
|
||||||
|
);
|
||||||
|
|
||||||
|
const preview: Preview = {
|
||||||
|
parameters: {
|
||||||
|
controls: {
|
||||||
|
matchers: {
|
||||||
|
color: /(background|color)$/i,
|
||||||
|
date: /Date$/i,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
globalTypes: {
|
||||||
|
theme: {
|
||||||
|
name: 'Theme',
|
||||||
|
description: 'Global theme for components',
|
||||||
|
defaultValue: 'default',
|
||||||
|
toolbar: {
|
||||||
|
items: listThemes(),
|
||||||
|
showName: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
scheme: {
|
||||||
|
name: 'Color Scheme',
|
||||||
|
description: 'Global color scheme for components',
|
||||||
|
defaultValue: 'default',
|
||||||
|
toolbar: {
|
||||||
|
items: listSchemes(),
|
||||||
|
showName: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
color: {
|
||||||
|
name: 'Color',
|
||||||
|
description: 'Global color for components',
|
||||||
|
defaultValue: 'light',
|
||||||
|
toolbar: {
|
||||||
|
items: ['auto', 'light', 'dark'],
|
||||||
|
showName: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
decorators: [withThemeProvider],
|
||||||
|
};
|
||||||
|
|
||||||
|
export default preview;
|
Loading…
Reference in New Issue
Block a user