-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6fbe830
commit f0a5180
Showing
4 changed files
with
48 additions
and
32 deletions.
There are no files selected for viewing
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
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
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
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,33 +1,38 @@ | ||
import React from 'react'; | ||
import { StatusIndicatorProps, StatusIndicator, Text, FlexRow, FlexCell } from '@epam/uui'; | ||
import { StatusIndicatorProps, StatusIndicator, Text, FlexRow } from '@epam/uui'; | ||
import { ExampleProps } from '../types'; | ||
import { getAllPropValues } from '../utils'; | ||
|
||
const uuiIndicators: StatusIndicatorProps[] = [ | ||
{ color: 'neutral', caption: 'Neutral' }, | ||
{ color: 'info', caption: 'Info' }, | ||
{ color: 'success', caption: 'Success' }, | ||
{ color: 'warning', caption: 'Warning' }, | ||
{ color: 'critical', caption: 'Critical' }, | ||
]; | ||
export default function BasicStatusIndicatorExample(props: ExampleProps) { | ||
const colors = getAllPropValues('color', false, props) as StatusIndicatorProps['color'][]; | ||
|
||
export default function BasicStatusIndicatorExample() { | ||
return ( | ||
<> | ||
<FlexCell width={ 80 }> | ||
<FlexRow> | ||
<Text>Fill solid:</Text> | ||
</FlexRow> | ||
<FlexRow> | ||
<Text>Fill outline:</Text> | ||
</FlexRow> | ||
</FlexCell> | ||
<FlexCell width="auto"> | ||
<FlexRow columnGap="12" alignItems="center"> | ||
{ uuiIndicators.map((item) => <StatusIndicator caption={ item.caption } key={ item.color } color={ item.color } />) } | ||
</FlexRow> | ||
<FlexRow columnGap="12" alignItems="center"> | ||
{ uuiIndicators.map((item) => <StatusIndicator caption={ item.caption } key={ item.color } color={ item.color } fill="outline" />) } | ||
</FlexRow> | ||
</FlexCell> | ||
</> | ||
<div style={ { overflow: 'hidden' } }> | ||
<FlexRow> | ||
<Text>Fill solid:</Text> | ||
</FlexRow> | ||
<FlexRow rawProps={ { style: { flexWrap: 'wrap' } } } columnGap="12" rowGap="12" alignItems="center"> | ||
{ colors.map((color) => ( | ||
<StatusIndicator | ||
key={ color } | ||
color={ color } | ||
caption={ color.charAt(0).toUpperCase() + color.slice(1) } | ||
/> | ||
)) } | ||
</FlexRow> | ||
<FlexRow> | ||
<Text>Fill outline:</Text> | ||
</FlexRow> | ||
<FlexRow rawProps={ { style: { flexWrap: 'wrap' } } } columnGap="12" rowGap="12" alignItems="center"> | ||
{ colors.map((color) => ( | ||
<StatusIndicator | ||
key={ color } | ||
color={ color } | ||
caption={ color.charAt(0).toUpperCase() + color.slice(1) } | ||
fill="outline" | ||
/> | ||
)) } | ||
</FlexRow> | ||
</div> | ||
); | ||
} |