-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This reverts commit 4c5ff08.
- Loading branch information
Showing
4 changed files
with
150 additions
and
0 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
cl2-component-library/src/design/colors/Colors.stories.mdx
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,12 @@ | ||
import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks'; | ||
import Colors from './'; | ||
|
||
<Meta title="Design/Colors" /> | ||
|
||
# Colors | ||
|
||
<Canvas> | ||
<Story name="default"> | ||
<Colors /> | ||
</Story> | ||
</Canvas> |
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,75 @@ | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
import { fontSizes, themeColors, semanticColors } from '../../utils/styleUtils'; | ||
import Title from '../../components/Title'; | ||
|
||
const Container = styled.div<{ borderColor: string }>` | ||
width: 500px; | ||
line-height: normal; | ||
display: flex; | ||
flex-direction: row; | ||
flex-wrap: nowrap; | ||
padding-right: 10px; | ||
margin: 20px; | ||
border-radius: ${(props) => props.theme.borderRadius}; | ||
border: ${(props) => '2px solid ' + props.borderColor}; | ||
`; | ||
const Color = styled.div<{ backgroundColor?: string }>` | ||
min-height: 60px; | ||
min-width: 120px; | ||
background: ${(props) => props.backgroundColor}; | ||
`; | ||
|
||
const ColorText = styled.div` | ||
padding-left: 20px; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
`; | ||
|
||
const ColorTextKey = styled.div` | ||
font-weight: 500; | ||
font-size: ${fontSizes.xl}px; | ||
`; | ||
|
||
const ColorTextValue = styled.p` | ||
font-weight: 400; | ||
font-size: ${fontSizes.xs}px; | ||
`; | ||
|
||
const Colors = () => { | ||
return ( | ||
<> | ||
<Title> Semantic colors</Title> | ||
{Object.entries(semanticColors) | ||
.sort() | ||
.map(([key, value]) => { | ||
return ( | ||
<Container key={key} borderColor={value}> | ||
<Color backgroundColor={value} /> | ||
<ColorText> | ||
<ColorTextKey>{key}</ColorTextKey> | ||
<ColorTextValue>{value}</ColorTextValue> | ||
</ColorText> | ||
</Container> | ||
); | ||
})} | ||
<Title> Theme colors</Title> | ||
{Object.entries(themeColors) | ||
.sort() | ||
.map(([key, value]) => { | ||
return ( | ||
<Container key={key} borderColor={value}> | ||
<Color backgroundColor={value} /> | ||
<ColorText> | ||
<ColorTextKey>{key}</ColorTextKey> | ||
<ColorTextValue>{value}</ColorTextValue> | ||
</ColorText> | ||
</Container> | ||
); | ||
})} | ||
</> | ||
); | ||
}; | ||
|
||
export default Colors; |
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,12 @@ | ||
import { Meta, Story, Canvas } from '@storybook/addon-docs/blocks'; | ||
import Icons from './'; | ||
|
||
<Meta title="Design/Icons" /> | ||
|
||
# Icons | ||
|
||
<Canvas> | ||
<Story name="default"> | ||
<Icons /> | ||
</Story> | ||
</Canvas> |
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,51 @@ | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
import { fontSizes } from '../../utils/styleUtils'; | ||
import Icon, { icons, IconNames } from '../../components/Icon'; | ||
|
||
const Container = styled.div` | ||
width: 500px; | ||
line-height: normal; | ||
display: flex; | ||
flex-direction: row; | ||
flex-wrap: nowrap; | ||
padding-right: 10px; | ||
margin: 20px; | ||
border-radius: ${(props) => props.theme.borderRadius}; | ||
`; | ||
|
||
const IconText = styled.div` | ||
padding-left: 20px; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
div { | ||
font-weight: 500; | ||
font-size: ${fontSizes.xl}px; | ||
} | ||
p { | ||
font-weight: 400; | ||
font-size: ${fontSizes.xs}px; | ||
} | ||
`; | ||
|
||
const Icons = () => { | ||
return ( | ||
<> | ||
{Object.keys(icons) | ||
.sort() | ||
.map((key) => { | ||
return ( | ||
<Container key={key}> | ||
<Icon name={key as IconNames} width="24px" height="24px" /> | ||
<IconText> | ||
<div>{key}</div> | ||
</IconText> | ||
</Container> | ||
); | ||
})} | ||
</> | ||
); | ||
}; | ||
|
||
export default Icons; |