mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 02:21:48 +08:00
34 lines
605 B
Plaintext
34 lines
605 B
Plaintext
```js
|
|
// .storybook/preview.js
|
|
|
|
import { MDXProvider } from '@mdx-js/react';
|
|
|
|
import { DocsContainer } from '@storybook/blocks';
|
|
|
|
import * as DesignSystem from 'your-design-system';
|
|
|
|
export const MyDocsContainer = (props) => (
|
|
<MDXProvider
|
|
components={{
|
|
h1: DesignSystem.H1,
|
|
h2: DesignSystem.H2,
|
|
}}
|
|
>
|
|
<DocsContainer {...props} />
|
|
</MDXProvider>
|
|
);
|
|
|
|
export const parameters = {
|
|
actions: { argTypesRegex: '^on[A-Z].*' },
|
|
controls: {
|
|
matchers: {
|
|
color: /(background|color)$/i,
|
|
date: /Date$/,
|
|
},
|
|
},
|
|
docs: {
|
|
container: MyDocsContainer,
|
|
},
|
|
};
|
|
```
|