-
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 Text demo #DS-911
- Text demo in web-react is now same as demo in web and web-twig
- Loading branch information
1 parent
cce1910
commit 160142d
Showing
6 changed files
with
36 additions
and
101 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
46 changes: 0 additions & 46 deletions
46
packages/web-react/src/components/Text/demo/TextAllCombinations.tsx
This file was deleted.
Oops, something went wrong.
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,6 @@ | ||
import React from 'react'; | ||
import Text from '../Text'; | ||
|
||
const TextDefault = () => <Text>Text</Text>; | ||
|
||
export default TextDefault; |
12 changes: 5 additions & 7 deletions
12
packages/web-react/src/components/Text/demo/TextEmphasis.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,14 +1,12 @@ | ||
import React from 'react'; | ||
import Text from '../Text'; | ||
|
||
// @see: https://github.com/storybookjs/storybook/issues/8104#issuecomment-932310244 | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const Story = (props: unknown) => ( | ||
const TextEmphasis = () => ( | ||
<> | ||
<Text>Body Medium Text Regular</Text> | ||
<Text emphasis="bold">Body Medium Text Bold</Text> | ||
<Text emphasis="italic">Body Medium Text Italic</Text> | ||
<Text>Text regular</Text> | ||
<Text emphasis="bold">Text bold</Text> | ||
<Text emphasis="italic">Text italic</Text> | ||
</> | ||
); | ||
|
||
export default Story; | ||
export default TextEmphasis; |
27 changes: 15 additions & 12 deletions
27
packages/web-react/src/components/Text/demo/TextSizes.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,16 +1,19 @@ | ||
import React from 'react'; | ||
import { SizesExtended } from '../../../constants'; | ||
import Text from '../Text'; | ||
|
||
// @see: https://github.com/storybookjs/storybook/issues/8104#issuecomment-932310244 | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
const Story = (props: unknown) => ( | ||
<> | ||
<Text size="xsmall">Body XSmall Text Regular</Text> | ||
<Text size="small">Body Small Text Regular</Text> | ||
<Text size="medium">Body Medium Text Regular</Text> | ||
<Text size="large">Body Large Text Regular</Text> | ||
<Text size="xlarge">Body XLarge Text Regular</Text> | ||
</> | ||
); | ||
const TextSizes = () => { | ||
const sizes = Object.values(SizesExtended); | ||
|
||
export default Story; | ||
return ( | ||
<> | ||
{sizes.map((size) => ( | ||
<Text key={size} size={size}> | ||
Text {size} | ||
</Text> | ||
))} | ||
</> | ||
); | ||
}; | ||
|
||
export default TextSizes; |
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,32 +1,20 @@ | ||
// Because there is no `dist` directory during the CI run | ||
/* eslint-disable import/no-extraneous-dependencies, import/extensions, import/no-unresolved */ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom/client'; | ||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment, import/extensions, import/no-unresolved | ||
// @ts-ignore: No declaration file | ||
import icons from '@lmc-eu/spirit-icons/dist/icons'; | ||
import { IconsProvider } from '../../../context'; | ||
import DocsSection from '../../../../docs/DocsSections'; | ||
import Text from './Text'; | ||
import TextDefault from './TextDefault'; | ||
import TextSizes from './TextSizes'; | ||
import TextEmphasis from './TextEmphasis'; | ||
import BodyTypography from './TextAllCombinations'; | ||
|
||
ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render( | ||
<React.StrictMode> | ||
<IconsProvider value={icons}> | ||
<DocsSection title="Default"> | ||
<Text {...Text.args} /> | ||
</DocsSection> | ||
<DocsSection title="Sizes"> | ||
<TextSizes /> | ||
</DocsSection> | ||
<DocsSection title="Emphasis"> | ||
<TextEmphasis /> | ||
</DocsSection> | ||
<DocsSection title="Body Typography"> | ||
<BodyTypography /> | ||
</DocsSection> | ||
</IconsProvider> | ||
<DocsSection title="Default"> | ||
<TextDefault /> | ||
</DocsSection> | ||
<DocsSection title="Sizes"> | ||
<TextSizes /> | ||
</DocsSection> | ||
<DocsSection title="Emphasis"> | ||
<TextEmphasis /> | ||
</DocsSection> | ||
</React.StrictMode>, | ||
); |