iconSet.stories.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import React from 'react';
  2. import {withInfo} from '@storybook/addon-info';
  3. import styled from '@emotion/styled';
  4. import * as newIconset from 'app/icons';
  5. export default {
  6. title: 'Style/Icons',
  7. };
  8. export const IconSet = withInfo('Replace `InlineSvg` with icon components')(() => {
  9. return (
  10. <SwatchWrapper>
  11. <Header>Icon Set</Header>
  12. <Swatches>
  13. {Object.entries(newIconset).map(([key, Icon]) => (
  14. <Swatch key={key}>
  15. <Icon />
  16. <LabelWrapper>{key}</LabelWrapper>
  17. </Swatch>
  18. ))}
  19. </Swatches>
  20. </SwatchWrapper>
  21. );
  22. });
  23. const Header = styled('h5')`
  24. margin-bottom: 16px;
  25. `;
  26. const LabelWrapper = styled('div')`
  27. font-size: 14px;
  28. margin-left: 16px;
  29. `;
  30. const SwatchWrapper = styled('div')`
  31. border: 1px solid ${p => p.theme.borderLight};
  32. padding: 24px;
  33. `;
  34. const Swatches = styled('div')`
  35. display: grid;
  36. grid-template-columns: repeat(auto-fill, 160px);
  37. grid-gap: 8px;
  38. `;
  39. const Swatch = styled('div')`
  40. display: flex;
  41. align-items: center;
  42. min-height: 32px;
  43. svg {
  44. min-width: 32px;
  45. }
  46. `;