styles.tsx 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. import styled from '@emotion/styled';
  2. import {space} from 'sentry/styles/space';
  3. export const SubHeading = styled('h3')`
  4. font-size: ${p => p.theme.fontSizeLarge};
  5. font-weight: ${p => p.theme.fontWeightNormal};
  6. color: ${p => p.theme.textColor};
  7. margin: 0;
  8. overflow: hidden;
  9. text-overflow: ellipsis;
  10. white-space: nowrap;
  11. `;
  12. export const SectionHeading = styled('h4')`
  13. display: inline-grid;
  14. grid-auto-flow: column;
  15. gap: ${space(1)};
  16. align-items: center;
  17. color: ${p => p.theme.subText};
  18. font-size: ${p => p.theme.fontSizeMedium};
  19. margin: ${space(1)} 0;
  20. `;
  21. export const SectionValue = styled('span')`
  22. color: ${p => p.theme.subText};
  23. font-size: ${p => p.theme.fontSizeMedium};
  24. margin-right: ${space(1)};
  25. `;
  26. export const InlineContainer = styled('div')`
  27. display: grid;
  28. align-items: center;
  29. @media (min-width: ${p => p.theme.breakpoints.small}) {
  30. grid-auto-flow: column;
  31. grid-column-gap: ${space(1)};
  32. }
  33. `;
  34. export const ChartControls = styled('div')`
  35. padding: ${space(1)} ${space(1)} ${space(1)} ${space(3)};
  36. border-top: 1px solid ${p => p.theme.border};
  37. @media (min-width: ${p => p.theme.breakpoints.small}) {
  38. display: flex;
  39. justify-content: space-between;
  40. flex-wrap: wrap;
  41. }
  42. `;
  43. // Header element for charts within panels.
  44. // @TODO(jonasbadalic) This should be a title component and not a div
  45. export const HeaderTitle = styled('div')`
  46. display: inline-grid;
  47. grid-auto-flow: column;
  48. gap: ${space(1)};
  49. color: ${p => p.theme.headingColor};
  50. align-items: center;
  51. /* @TODO(jonasbadalic) This should be a title component and not a div */
  52. font-size: 1rem;
  53. font-weight: ${p => p.theme.fontWeightBold};
  54. line-height: 1.2;
  55. `;
  56. // Header element for charts within panels
  57. // This header can be rendered while the chart is still loading
  58. export const HeaderTitleLegend = styled(HeaderTitle)`
  59. background-color: ${p => p.theme.background};
  60. border-bottom-right-radius: ${p => p.theme.borderRadius};
  61. position: absolute;
  62. z-index: 1;
  63. `;
  64. // Used for rendering total value of a chart right below the HeaderTitleLegend
  65. export const HeaderValue = styled('div')`
  66. display: inline-grid;
  67. grid-auto-flow: column;
  68. gap: ${space(1)};
  69. align-items: baseline;
  70. background-color: ${p => p.theme.background};
  71. position: absolute;
  72. top: 40px;
  73. z-index: 1;
  74. font-size: ${p => p.theme.headerFontSize};
  75. `;
  76. export const ChartContainer = styled('div')`
  77. padding: ${space(2)} ${space(3)};
  78. `;