ProgressDrawer.styles.tsx 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. import isPropValid from '@emotion/is-prop-valid'
  2. import styled from '@emotion/styled'
  3. import { SvgGlyphChevronDown } from '@/shared/icons'
  4. import { colors, sizes, transitions } from '@/shared/theme'
  5. import { CircularProgress } from '../CircularProgress'
  6. import { Text } from '../Text'
  7. export const Container = styled.div`
  8. width: 280px;
  9. overflow-y: hidden;
  10. `
  11. export const CircularProgresaBarContainer = styled.div`
  12. display: flex;
  13. align-items: center;
  14. `
  15. export const StyledCircularProgress = styled(CircularProgress)`
  16. margin-left: ${sizes(2)};
  17. margin-right: ${sizes(2)};
  18. width: ${sizes(6)};
  19. height: ${sizes(6)};
  20. `
  21. export const StepsProgressContainer = styled.div`
  22. display: flex;
  23. width: 100%;
  24. justify-content: space-between;
  25. align-items: center;
  26. `
  27. export const BottomRowContainer = styled.div`
  28. padding: ${sizes(4)};
  29. background-color: ${colors.gray[800]};
  30. display: flex;
  31. justify-content: space-between;
  32. align-items: center;
  33. position: relative;
  34. z-index: 1;
  35. `
  36. type StepsContainerProps = {
  37. isHidden?: boolean
  38. }
  39. export const StepsContainer = styled.div<StepsContainerProps>`
  40. display: grid;
  41. grid-auto-flow: row;
  42. padding: ${sizes(4)};
  43. transform: translateY(${({ isHidden }) => (isHidden ? '150%' : '0%')});
  44. background-color: ${colors.gray[800]};
  45. transition: transform ${transitions.timings.regular} ${transitions.easing};
  46. position: relative;
  47. z-index: 1;
  48. `
  49. export const StyledSvgGlyphChevronDown = styled(SvgGlyphChevronDown, { shouldForwardProp: isPropValid })<
  50. StepsContainerProps
  51. >`
  52. transform: rotate(${({ isHidden }) => (isHidden ? '-180deg' : '0deg')});
  53. transition: transform ${transitions.timings.regular} ${transitions.easing};
  54. `
  55. type StepStateProps = {
  56. completed: boolean
  57. }
  58. export const StepState = styled.div<StepStateProps>`
  59. width: ${sizes(6)};
  60. height: ${sizes(6)};
  61. display: flex;
  62. flex-shrink: 0;
  63. align-items: center;
  64. justify-content: center;
  65. border-radius: 100%;
  66. ${({ completed }) => [
  67. completed &&
  68. `background-color: ${colors.blue[500]};
  69. border: 2px solid transparent;`,
  70. completed === false && `border: 2px solid ${colors.gray[300]}`,
  71. ]};
  72. `
  73. export const Step = styled.div<StepStateProps>`
  74. cursor: ${({ completed }) => (completed ? 'initial' : 'pointer')};
  75. display: grid;
  76. grid-auto-flow: column;
  77. justify-content: space-between;
  78. align-items: center;
  79. padding: ${sizes(2)};
  80. margin-bottom: ${sizes(2)};
  81. :last-of-type {
  82. position: relative;
  83. ::after {
  84. bottom: -${sizes(4)};
  85. position: absolute;
  86. content: '';
  87. width: 100%;
  88. height: 1px;
  89. background-color: ${colors.gray[300]};
  90. }
  91. }
  92. :hover {
  93. background-color: ${({ completed }) => !completed && colors.transparentPrimary[18]};
  94. }
  95. `
  96. export const StepsCompletedText = styled(Text)`
  97. min-width: 25px;
  98. text-align: right;
  99. `
  100. export const StepInnerContainer = styled.div`
  101. display: grid;
  102. grid-auto-flow: column;
  103. grid-gap: ${sizes(3)};
  104. align-items: center;
  105. `