stepHeading.tsx 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import styled from '@emotion/styled';
  2. import {motion} from 'framer-motion';
  3. import {space} from 'sentry/styles/space';
  4. import testableTransition from 'sentry/utils/testableTransition';
  5. const StepHeading = styled(
  6. (props: React.ComponentProps<typeof motion.h2> & {step: number}) => (
  7. <motion.h2
  8. variants={{
  9. initial: {clipPath: 'inset(0% 100% 0% 0%)', opacity: 1},
  10. animate: {clipPath: 'inset(0% 0% 0% 0%)', opacity: 1},
  11. exit: {opacity: 0},
  12. }}
  13. transition={testableTransition({
  14. duration: 0.3,
  15. })}
  16. {...props}
  17. />
  18. )
  19. )`
  20. margin-left: calc(-${space(2)} - 30px);
  21. position: relative;
  22. display: inline-grid;
  23. grid-template-columns: max-content auto;
  24. gap: ${space(2)};
  25. align-items: center;
  26. &:before {
  27. content: '${p => p.step}';
  28. display: flex;
  29. align-items: center;
  30. justify-content: center;
  31. width: 30px;
  32. height: 30px;
  33. background-color: ${p => p.theme.yellow300};
  34. border-radius: 50%;
  35. color: ${p => p.theme.textColor};
  36. font-size: 1rem;
  37. }
  38. `;
  39. export default StepHeading;