Skip to content

Commit

Permalink
docs: added icons story
Browse files Browse the repository at this point in the history
  • Loading branch information
Swiftwork committed Dec 19, 2019
1 parent 0e1fd99 commit 8d126f4
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 19 deletions.
34 changes: 34 additions & 0 deletions packages/ui-icons/src/icons.stories.tsx
@@ -0,0 +1,34 @@
import React from 'react';
import { withKnobs, number, color } from '@storybook/addon-knobs';

const iconContext = require.context('./icons/', false, /\.svg$/);
const keys = iconContext.keys() as string[];
const paths = keys.map(iconContext) as string[];

export default {
title: 'Icons',
decorators: [withKnobs],
};

export const basic = () => {
const size = number('Size', 32, {
range: true,
min: 16,
max: 128,
});
return (
<div className="e-grid style-uniform">
{paths.map(icon => (
<svg
key={icon}
fill={color('Color', 'rgba(0,0,0,1)')}
style={{
width: size,
height: size,
}}>
<use xlinkHref={`${icon}#Layer_1`} width={size} height={size} />
</svg>
))}
</div>
);
};
14 changes: 5 additions & 9 deletions packages/ui-icons/src/icons/arrows-horizontal.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 6 additions & 9 deletions packages/ui-icons/src/icons/arrows-vertical.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/ui-icons/src/icons/loader.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8d126f4

Please sign in to comment.