Skip to content

Commit

Permalink
docs(ColorPage): table of colors
Browse files Browse the repository at this point in the history
  • Loading branch information
VadymBezpalko committed Jan 25, 2024
1 parent 418ee6d commit d4c9d66
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 1,837 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Meta, Canvas } from '@storybook/addon-docs';
import { ColorTokensPallete } from './ColorTokens';
import { ColorTable } from './ColorTable';
import { ColorsTokens } from './constants';

<Meta title="Foundations/Color" />

Expand Down Expand Up @@ -27,5 +28,5 @@ Content color tokens in a design system help organize information visually. By a
backgroundColor: 'var(--background)',
}}
>
<ColorTokensPallete />
<ColorTable data={ColorsTokens}></ColorTable>
</Canvas>
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import * as React from 'react';

import { ColorShape } from './types';

interface IColorTableProps {
data: ColorShape[];
}

export const ColorTable: React.FC<IColorTableProps> = ({ data }) => {
return (
<table>
<thead>
<tr>
<th>Example</th>
<th>Enum</th>
<th>Token</th>
<th>Usage</th>
</tr>
</thead>
<tbody>
{data.map((color) => (
<tr>
<td>
<div
className="color-example"
style={{ backgroundColor: color.value }}
/>
</td>
<td>DesignToken.{color.enum}</td>
<td>{color.value}</td>
<td>{color.desc}</td>
</tr>
))}
</tbody>
</table>
);
};
159 changes: 0 additions & 159 deletions packages/react-components/src/docs/foundations/Color/ColorTokens.tsx

This file was deleted.

Loading

0 comments on commit d4c9d66

Please sign in to comment.