mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-09 00:19:13 +08:00
78 lines
1.8 KiB
Plaintext
78 lines
1.8 KiB
Plaintext
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
exports[`docs-mdx-compiler-plugin component-args.mdx 1`] = `
|
|
"/* @jsxRuntime classic */
|
|
/* @jsx mdx */
|
|
import { assertIsFn, AddContext } from '@storybook/addon-docs';
|
|
|
|
import { Button } from '@storybook/react/demo';
|
|
import { Story, Meta } from '@storybook/addon-docs';
|
|
|
|
const layoutProps = {};
|
|
const MDXLayout = 'wrapper';
|
|
function MDXContent({ components, ...props }) {
|
|
return (
|
|
<MDXLayout {...layoutProps} {...props} components={components} mdxType=\\"MDXLayout\\">
|
|
<Meta
|
|
title=\\"Button\\"
|
|
args={{
|
|
a: 1,
|
|
b: 2,
|
|
}}
|
|
argTypes={{
|
|
a: {
|
|
name: 'A',
|
|
},
|
|
b: {
|
|
name: 'B',
|
|
},
|
|
}}
|
|
mdxType=\\"Meta\\"
|
|
/>
|
|
<h1>{\`Args\`}</h1>
|
|
<Story name=\\"component notes\\" mdxType=\\"Story\\">
|
|
<Button mdxType=\\"Button\\">Component notes</Button>
|
|
</Story>
|
|
</MDXLayout>
|
|
);
|
|
}
|
|
|
|
MDXContent.isMDXComponent = true;
|
|
|
|
export const componentNotes = () => <Button>Component notes</Button>;
|
|
componentNotes.storyName = 'component notes';
|
|
componentNotes.parameters = { storySource: { source: '<Button>Component notes</Button>' } };
|
|
|
|
const componentMeta = {
|
|
title: 'Button',
|
|
args: {
|
|
a: 1,
|
|
b: 2,
|
|
},
|
|
argTypes: {
|
|
a: {
|
|
name: 'A',
|
|
},
|
|
b: {
|
|
name: 'B',
|
|
},
|
|
},
|
|
includeStories: ['componentNotes'],
|
|
};
|
|
|
|
const mdxStoryNameToKey = { 'component notes': 'componentNotes' };
|
|
|
|
componentMeta.parameters = componentMeta.parameters || {};
|
|
componentMeta.parameters.docs = {
|
|
...(componentMeta.parameters.docs || {}),
|
|
page: () => (
|
|
<AddContext mdxStoryNameToKey={mdxStoryNameToKey} mdxComponentAnnotations={componentMeta}>
|
|
<MDXContent />
|
|
</AddContext>
|
|
),
|
|
};
|
|
|
|
export default componentMeta;
|
|
"
|
|
`;
|