Skip to content

Commit

Permalink
Revert "Remove dead code 3"
Browse files Browse the repository at this point in the history
This reverts commit 4c5ff08.
  • Loading branch information
brentguf committed Mar 19, 2024
1 parent 4c5ff08 commit b403d26
Show file tree
Hide file tree
Showing 4 changed files with 150 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cl2-component-library/src/design/colors/Colors.stories.mdx
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>
75 changes: 75 additions & 0 deletions cl2-component-library/src/design/colors/index.tsx
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;
12 changes: 12 additions & 0 deletions cl2-component-library/src/design/icons/Icons.stories.mdx
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>
51 changes: 51 additions & 0 deletions cl2-component-library/src/design/icons/index.tsx
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;

0 comments on commit b403d26

Please sign in to comment.