Metrics.styled.tsx 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. import styled, { css } from 'styled-components';
  2. import { AlertType } from 'redux/interfaces';
  3. export const Wrapper = styled.div`
  4. padding: 1.5rem 1rem;
  5. background: ${({ theme }) => theme.metrics.backgroundColor};
  6. margin-bottom: 0.5rem !important;
  7. display: flex;
  8. gap: 16px;
  9. flex-wrap: wrap;
  10. `;
  11. export const IndicatorWrapper = styled.div`
  12. background-color: ${({ theme }) => theme.metrics.indicator.backgroundColor};
  13. height: 68px;
  14. width: fit-content;
  15. min-width: 150px;
  16. display: flex;
  17. flex-direction: column;
  18. justify-content: center;
  19. align-items: flex-start;
  20. padding: 12px 16px;
  21. box-shadow: 3px 3px 3px rgba(0, 0, 0, 0.08);
  22. margin: 0 0 3px 0;
  23. flex-grow: 1;
  24. `;
  25. export const IndicatorTitle = styled.div`
  26. font-weight: 500;
  27. font-size: 12px;
  28. color: ${({ theme }) => theme.metrics.indicator.titleColor};
  29. display: flex;
  30. align-items: center;
  31. gap: 10px;
  32. `;
  33. export const IndicatorsWrapper = styled.div`
  34. display: flex;
  35. gap: 2px;
  36. flex-wrap: wrap;
  37. > ${IndicatorWrapper} {
  38. &:first-child {
  39. border-top-left-radius: 8px;
  40. border-bottom-left-radius: 8px;
  41. }
  42. &:last-child {
  43. border-top-right-radius: 8px;
  44. border-bottom-right-radius: 8px;
  45. }
  46. }
  47. @media screen and (max-width: 1023px) {
  48. > ${IndicatorWrapper} {
  49. &:first-child,
  50. &:last-child {
  51. border-radius: 0;
  52. }
  53. }
  54. }
  55. `;
  56. export const SectionTitle = styled.h5`
  57. font-weight: 500;
  58. margin: 0 0 0.5rem 0;
  59. font-size: 100%;
  60. `;
  61. export const LightText = styled.span`
  62. color: ${({ theme }) => theme.metrics.indicator.lightTextColor};
  63. font-size: 14px;
  64. `;
  65. export const RedText = styled.span`
  66. color: ${({ theme }) => theme.metrics.indicator.warningTextColor};
  67. font-size: 14px;
  68. `;
  69. export const CircularAlertWrapper = styled.svg.attrs({
  70. role: 'svg',
  71. viewBox: '0 0 4 4',
  72. xmlns: 'http://www.w3.org/2000/svg',
  73. })`
  74. grid-area: status;
  75. fill: none;
  76. width: 4px;
  77. height: 4px;
  78. `;
  79. export const CircularAlert = styled.circle.attrs({
  80. role: 'circle',
  81. cx: 2,
  82. cy: 2,
  83. r: 2,
  84. })<{
  85. $type: AlertType;
  86. }>(
  87. ({ theme, $type }) => css`
  88. fill: ${theme.circularAlert.color[$type]};
  89. `
  90. );