stepHeading.tsx 1.0 KB

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