mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-09 00:19:13 +08:00
79 lines
2.1 KiB
Plaintext
79 lines
2.1 KiB
Plaintext
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
exports[`docs-mdx-compiler-plugin parameters.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\\"
|
|
component={Button}
|
|
parameters={{
|
|
notes: 'component notes',
|
|
}}
|
|
mdxType=\\"Meta\\"
|
|
/>
|
|
<Story name=\\"component notes\\" mdxType=\\"Story\\">
|
|
<Button mdxType=\\"Button\\">Component notes</Button>
|
|
</Story>
|
|
<Story
|
|
name=\\"story notes\\"
|
|
parameters={{
|
|
notes: 'story notes',
|
|
}}
|
|
mdxType=\\"Story\\"
|
|
>
|
|
<Button mdxType=\\"Button\\">Story 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>' } };
|
|
|
|
export const storyNotes = () => <Button>Story notes</Button>;
|
|
storyNotes.storyName = 'story notes';
|
|
storyNotes.parameters = {
|
|
storySource: { source: '<Button>Story notes</Button>' },
|
|
...{
|
|
notes: 'story notes',
|
|
},
|
|
};
|
|
|
|
const componentMeta = {
|
|
title: 'Button',
|
|
parameters: {
|
|
notes: 'component notes',
|
|
},
|
|
component: Button,
|
|
includeStories: ['componentNotes', 'storyNotes'],
|
|
};
|
|
|
|
const mdxStoryNameToKey = { 'component notes': 'componentNotes', 'story notes': 'storyNotes' };
|
|
|
|
componentMeta.parameters = componentMeta.parameters || {};
|
|
componentMeta.parameters.docs = {
|
|
...(componentMeta.parameters.docs || {}),
|
|
page: () => (
|
|
<AddContext mdxStoryNameToKey={mdxStoryNameToKey} mdxComponentAnnotations={componentMeta}>
|
|
<MDXContent />
|
|
</AddContext>
|
|
),
|
|
};
|
|
|
|
export default componentMeta;
|
|
"
|
|
`;
|