Skip to content

Commit

Permalink
Docs(web-react): Add Heading demo #DS-899
Browse files Browse the repository at this point in the history
Heading demo in web-react is now same as demo in web and web-twig
  • Loading branch information
pavelklibani committed Sep 13, 2023
1 parent 8b0255f commit d5a88a9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 55 deletions.
11 changes: 11 additions & 0 deletions packages/web-react/src/components/Heading/demo/HeadingDefault.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import React from 'react';
import Heading from '../Heading';

const HeadingDefault = () => (
<>
<Heading>Heading</Heading>
<Heading elementType="h2">Heading H2</Heading>
</>
);

export default HeadingDefault;
30 changes: 0 additions & 30 deletions packages/web-react/src/components/Heading/demo/HeadingLinks.tsx

This file was deleted.

26 changes: 7 additions & 19 deletions packages/web-react/src/components/Heading/demo/HeadingSizes.tsx
Original file line number Diff line number Diff line change
@@ -1,26 +1,14 @@
import React from 'react';
import Heading from '../Heading';

// @see: https://github.com/storybookjs/storybook/issues/8104#issuecomment-932310244
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const Story = (props: unknown) => (
const HeadingSizes = () => (
<>
<Heading elementType="p" size="xlarge">
Heading XLarge Text
</Heading>
<Heading elementType="p" size="large">
Heading Large Text
</Heading>
<Heading elementType="p" size="medium">
Heading Medium Text
</Heading>
<Heading elementType="p" size="small">
Heading Small Text
</Heading>
<Heading elementType="p" size="xsmall">
Heading XSmall Text
</Heading>
<Heading size="xsmall">Heading xsmall</Heading>
<Heading size="small">Heading small</Heading>
<Heading size="medium">Heading medium</Heading>
<Heading size="large">Heading large</Heading>
<Heading size="xlarge">Heading xlarge</Heading>
</>
);

export default Story;
export default HeadingSizes;
8 changes: 2 additions & 6 deletions packages/web-react/src/components/Heading/demo/index.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import DocsSection from '../../../../docs/DocsSections';
import Heading from './Heading';
import HeadingSizes from './HeadingSizes';
import HeadingLinks from './HeadingLinks';
import HeadingDefault from './HeadingDefault';

ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(
<React.StrictMode>
<DocsSection title="Default">
<Heading {...Heading.args} />
<HeadingDefault />
</DocsSection>
<DocsSection title="Sizes">
<HeadingSizes />
</DocsSection>
<DocsSection title="Links">
<HeadingLinks />
</DocsSection>
</React.StrictMode>,
);

0 comments on commit d5a88a9

Please sign in to comment.