iconSet.stories.js 1005 B

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