-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Docs(web-react): Add Heading demo #DS-899
Heading demo in web-react is now same as demo in web and web-twig
- Loading branch information
1 parent
8b0255f
commit d5a88a9
Showing
4 changed files
with
20 additions
and
55 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
packages/web-react/src/components/Heading/demo/HeadingDefault.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
30
packages/web-react/src/components/Heading/demo/HeadingLinks.tsx
This file was deleted.
Oops, something went wrong.
26 changes: 7 additions & 19 deletions
26
packages/web-react/src/components/Heading/demo/HeadingSizes.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>, | ||
); |