scoreCard.stories.js 997 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import styled from '@emotion/styled';
  2. import ScoreCard from 'sentry/components/scoreCard';
  3. import {t} from 'sentry/locale';
  4. import space from 'sentry/styles/space';
  5. export default {
  6. title: 'Components/Data Visualization/Score Card',
  7. component: ScoreCard,
  8. };
  9. export const Default = () => (
  10. <Wrapper>
  11. <ScoreCard
  12. title={t('First Score')}
  13. help={t('First score is used to ...')}
  14. score="94.1%"
  15. trend="+13.5%"
  16. trendStatus="good"
  17. />
  18. <ScoreCard
  19. title={t('Velocity Score')}
  20. help={t('Velocity score is used to ...')}
  21. score="16"
  22. trend="-2 releases / 2 wks"
  23. trendStatus="bad"
  24. />
  25. <ScoreCard
  26. title={t('Other Score')}
  27. help={t('Other score is used to ...')}
  28. score="0.95"
  29. trend="+0.2"
  30. />
  31. <ScoreCard title={t('Minimal')} />
  32. </Wrapper>
  33. );
  34. Default.storyName = 'Default';
  35. const Wrapper = styled('div')`
  36. display: grid;
  37. gap: ${space(1)};
  38. grid-template-columns: repeat(4, minmax(0, 1fr));
  39. `;