Skip to content

docs(Badge): enhance story #730

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 58 additions & 13 deletions packages/main/src/webComponents/Badge/Badge.stories.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs/blocks';
import { ArgsTable, Canvas, Meta, Story } from '@storybook/addon-docs/blocks';
import { Badge } from '@ui5/webcomponents-react/lib/Badge';
import '@ui5/webcomponents-icons/dist/icons/employee.js';
import { Icon } from '@ui5/webcomponents-react/lib/Icon';
import { CSSProperties, Ref } from 'react';
import { FlexBox } from '@ui5/webcomponents-react/lib/FlexBox';
import { FlexBoxWrap } from '@ui5/webcomponents-react/lib/FlexBoxWrap';
import { CSSProperties } from 'react';

import { createSelectArgTypes } from '@shared/stories/createSelectArgTypes';
import { DocsHeader } from '@shared/stories/DocsHeader';
Expand Down Expand Up @@ -50,14 +52,57 @@ import { DocsHeader } from '@shared/stories/DocsHeader';
</Canvas>

<ArgsTable story="." />
<div style={{fontFamily:'var(--sapFontFamily)', fontSize:'var(--sapFontSize)', color:'var(--sapTextColor)'}}>
<h3>Usage Guidelines</h3>
<ul>
<li>If the text is longer than the width of the component, it doesn’t wrap, it shows ellipsis.</li>
<li>
When truncated, the full text is not visible, therefore, it’s recommended to make more space for longer texts to be
fully displayed.
</li>
<li>Colors are not semantic and have no visual representation in High Contrast Black (sap_belize_hcb) theme.</li>
</ul>
</div>
<div style={{ fontFamily: 'var(--sapFontFamily)', fontSize: 'var(--sapFontSize)', color: 'var(--sapTextColor)' }}>
<h3>Usage Guidelines</h3>
<ul>
<li>If the text is longer than the width of the component, it doesn’t wrap, it shows ellipsis.</li>
<li>
When truncated, the full text is not visible, therefore, it’s recommended to make more space for longer texts to
be fully displayed.
</li>
<li>Colors are not semantic and have no visual representation in High Contrast Black (sap_belize_hcb) theme.</li>
</ul>
</div>

# Stories

## All available Badge colors

<Canvas>
<Story name="All colors">
{() => {
return (
<FlexBox wrap={FlexBoxWrap.Wrap}>
<Badge colorScheme="1" style={{ marginRight: '10px', marginBottom: '10px' }}>
colorScheme = "1"
</Badge>
<Badge colorScheme="2" style={{ marginRight: '10px', marginBottom: '10px' }}>
colorScheme = "2"
</Badge>
<Badge colorScheme="3" style={{ marginRight: '10px', marginBottom: '10px' }}>
colorScheme = "3"
</Badge>
<Badge colorScheme="4" style={{ marginRight: '10px', marginBottom: '10px' }}>
colorScheme = "4"
</Badge>
<Badge colorScheme="5" style={{ marginRight: '10px', marginBottom: '10px' }}>
colorScheme = "5"
</Badge>
<Badge colorScheme="6" style={{ marginRight: '10px', marginBottom: '10px' }}>
colorScheme = "6"
</Badge>
<Badge colorScheme="7" style={{ marginRight: '10px', marginBottom: '10px' }}>
colorScheme = "7"
</Badge>
<Badge colorScheme="8" style={{ marginRight: '10px', marginBottom: '10px' }}>
colorScheme = "8"
</Badge>
<Badge colorScheme="9" style={{ marginRight: '10px', marginBottom: '10px' }}>
colorScheme = "9"
</Badge>
<Badge colorScheme="10">colorScheme = "10"</Badge>
</FlexBox>
);
}}
</Story>
</Canvas>