Skip to content

Commit

Permalink
Merge pull request #7788 from storybookjs/6803-unwrap-chromatic-stories
Browse files Browse the repository at this point in the history
Addon-docs: Unwrap doc blocks stories
  • Loading branch information
shilman authored Aug 17, 2019
2 parents 2acbcd6 + 4b753ac commit 1cf3f3e
Show file tree
Hide file tree
Showing 10 changed files with 4 additions and 22 deletions.
2 changes: 0 additions & 2 deletions lib/components/src/blocks/ColorPalette.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React from 'react';
import { ColorItem, ColorPalette } from './ColorPalette';
import { DocsPageWrapper } from './DocsPage';

export default {
title: 'Docs|ColorPalette',
component: ColorPalette,
decorators: [getStory => <DocsPageWrapper>{getStory()}</DocsPageWrapper>],
};

export const defaultStyle = () => (
Expand Down
2 changes: 0 additions & 2 deletions lib/components/src/blocks/Description.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import React from 'react';
import { Description } from './Description';

import { DocsPageWrapper } from './DocsPage';
import markdownCaption from './DocsPageExampleCaption.md';

export default {
title: 'Docs|Description',
component: Description,
decorators: [getStory => <DocsPageWrapper>{getStory()}</DocsPageWrapper>],
};

const textCaption = `That was Wintermute, manipulating the lock the way it had manipulated the drone micro and the amplified breathing of the room where Case waited. The semiotics of the bright void beyond the chain link. The tug Marcus Garvey, a steel drum nine meters long and two in diameter, creaked and shuddered as Maelcum punched for a California gambling cartel, then as a paid killer in the dark, curled in his capsule in some coffin hotel, his hands clawed into the nearest door and watched the other passengers as he rode. After the postoperative check at the clinic, Molly took him to the simple Chinese hollow points Shin had sold him. Still it was a handgun and nine rounds of ammunition, and as he made his way down Shiga from the missionaries, the train reached Case’s station. Now this quiet courtyard, Sunday afternoon, this girl with a random collection of European furniture, as though Deane had once intended to use the place as his home. Case felt the edge of the Flatline as a construct, a hardwired ROM cassette replicating a dead man’s skills, obsessions, kneejerk responses. They were dropping, losing altitude in a canyon of rainbow foliage, a lurid communal mural that completely covered the hull of the console in faded pinks and yellows.`;
Expand Down
2 changes: 0 additions & 2 deletions lib/components/src/blocks/EmptyBlock.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React from 'react';
import { EmptyBlock } from './EmptyBlock';
import { DocsPageWrapper } from './DocsPage';

export default {
title: 'Docs|EmptyBlock',
component: EmptyBlock,
decorators: [getStory => <DocsPageWrapper>{getStory()}</DocsPageWrapper>],
};

export const error = () => <EmptyBlock>Generic error message</EmptyBlock>;
2 changes: 0 additions & 2 deletions lib/components/src/blocks/IconGallery.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import React from 'react';
import { IconItem, IconGallery } from './IconGallery';

import { DocsPageWrapper } from './DocsPage';
import { Icons as ExampleIcon } from '../icon/icon';

export default {
title: 'Docs|IconGallery',
component: IconGallery,
decorators: [getStory => <DocsPageWrapper>{getStory()}</DocsPageWrapper>],
};

export const defaultStyle = () => (
Expand Down
4 changes: 1 addition & 3 deletions lib/components/src/blocks/Preview.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
import React from 'react';

import { Preview } from './Preview';

import { Story } from './Story';
import { Button } from '../Button/Button';

import { DocsPageWrapper } from './DocsPage';
import * as sourceStories from './Source.stories';

export default {
title: 'Docs|Preview',
component: Preview,
decorators: [getStory => <DocsPageWrapper>{getStory()}</DocsPageWrapper>],
};

export const codeCollapsed = () => (
Expand Down
6 changes: 3 additions & 3 deletions lib/components/src/blocks/PropsTable/PropRow.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import React from 'react';
import { PropRow } from './PropRow';
import { Table } from './PropsTable';
import { DocsPageWrapper } from '../DocsPage';
import { ResetWrapper } from '../../typography/DocumentFormatting';

export default {
component: PropRow,
title: 'Docs|PropRow',
excludeStories: /.*Def$/,
decorators: [
getStory => (
<DocsPageWrapper>
<ResetWrapper>
<Table>
<tbody>{getStory()}</tbody>
</Table>
</DocsPageWrapper>
</ResetWrapper>
),
],
};
Expand Down
2 changes: 0 additions & 2 deletions lib/components/src/blocks/PropsTable/PropsTable.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import React from 'react';
import { PropsTable, PropsTableError } from './PropsTable';
import { stringDef, numberDef } from './PropRow.stories';
import { DocsPageWrapper } from '../DocsPage';

export default {
component: PropsTable,
title: 'Docs|PropTable',
decorators: [getStory => <DocsPageWrapper>{getStory()}</DocsPageWrapper>],
};

export const normal = () => <PropsTable rows={[stringDef, numberDef]} />;
Expand Down
2 changes: 0 additions & 2 deletions lib/components/src/blocks/Source.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React from 'react';
import { Source, SourceError } from './Source';
import { DocsPageWrapper } from './DocsPage';

export default {
title: 'Docs|Source',
component: Source,
decorators: [getStory => <DocsPageWrapper>{getStory()}</DocsPageWrapper>],
};

const jsxCode = `
Expand Down
2 changes: 0 additions & 2 deletions lib/components/src/blocks/Story.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import React from 'react';
import { Story, StoryError } from './Story';
import { Button } from '../Button/Button';
import { DocsPageWrapper } from './DocsPage';

export default {
title: 'Docs|Story',
component: Story,
decorators: [getStory => <DocsPageWrapper>{getStory()}</DocsPageWrapper>],
};

const buttonFn = () => <Button secondary>Inline story</Button>;
Expand Down
2 changes: 0 additions & 2 deletions lib/components/src/blocks/Typeset.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import React from 'react';
import { Typeset } from './Typeset';
import { DocsPageWrapper } from './DocsPage';

export default {
title: 'Docs|Typeset',
component: Typeset,
decorators: [getStory => <DocsPageWrapper>{getStory()}</DocsPageWrapper>],
};

const fontSizes = [12, 14, 16, 20, 24, 32, 40, 48];
Expand Down

0 comments on commit 1cf3f3e

Please sign in to comment.