styles.tsx 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. import styled from '@emotion/styled';
  2. import Panel from 'sentry/components/panels/panel';
  3. import PanelHeader from 'sentry/components/panels/panelHeader';
  4. import PanelItem from 'sentry/components/panels/panelItem';
  5. import {space} from 'sentry/styles/space';
  6. export const StyledPanel = styled(Panel)`
  7. margin-bottom: 0px;
  8. `;
  9. export const StyledPanelHeader = styled(PanelHeader)<{align: 'left' | 'right'}>`
  10. white-space: nowrap;
  11. justify-content: ${p => (p.align === 'left' ? 'flex-start' : 'flex-end')};
  12. `;
  13. export const TracePanelContent = styled('div')`
  14. width: 100%;
  15. display: grid;
  16. grid-template-columns: 116px auto repeat(2, min-content) 85px 112px 66px;
  17. `;
  18. export const StyledPanelItem = styled(PanelItem)<{
  19. align?: 'left' | 'center' | 'right';
  20. overflow?: boolean;
  21. span?: number;
  22. }>`
  23. align-items: center;
  24. padding: ${space(1)} ${space(2)};
  25. ${p => (p.align === 'left' ? 'justify-content: flex-start;' : null)}
  26. ${p => (p.align === 'right' ? 'justify-content: flex-end;' : null)}
  27. ${p => (p.overflow ? p.theme.overflowEllipsis : null)};
  28. ${p =>
  29. p.align === 'center'
  30. ? `
  31. justify-content: space-around;`
  32. : p.align === 'left' || p.align === 'right'
  33. ? `text-align: ${p.align};`
  34. : undefined}
  35. ${p => p.span && `grid-column: auto / span ${p.span};`}
  36. white-space: nowrap;
  37. `;
  38. export const MoreMatchingSpans = styled(StyledPanelItem)`
  39. color: ${p => p.theme.gray300};
  40. `;
  41. export const WrappingText = styled('div')`
  42. width: 100%;
  43. ${p => p.theme.overflowEllipsis};
  44. `;
  45. export const StyledSpanPanelItem = styled(StyledPanelItem)`
  46. &:nth-child(10n + 1),
  47. &:nth-child(10n + 2),
  48. &:nth-child(10n + 3),
  49. &:nth-child(10n + 4),
  50. &:nth-child(10n + 5) {
  51. background-color: ${p => p.theme.backgroundSecondary};
  52. }
  53. `;
  54. export const SpanTablePanelItem = styled(StyledPanelItem)`
  55. background-color: ${p => p.theme.gray100};
  56. `;
  57. export const BreakdownPanelItem = styled(StyledPanelItem)<{highlightedSliceName: string}>`
  58. ${p =>
  59. p.highlightedSliceName
  60. ? `--highlightedSlice-${p.highlightedSliceName}-opacity: 1.0;
  61. --highlightedSlice-${p.highlightedSliceName}-saturate: saturate(1.0) contrast(1.0);
  62. --highlightedSlice-${p.highlightedSliceName}-transform: translateY(0px);
  63. `
  64. : null}
  65. ${p =>
  66. p.highlightedSliceName
  67. ? `
  68. --defaultSlice-opacity: 1.0;
  69. --defaultSlice-saturate: saturate(0.7) contrast(0.9) brightness(1.2);
  70. --defaultSlice-transform: translateY(0px);
  71. `
  72. : `
  73. --defaultSlice-opacity: 1.0;
  74. --defaultSlice-saturate: saturate(1.0) contrast(1.0);
  75. --defaultSlice-transform: translateY(0px);
  76. `}
  77. `;
  78. export const EmptyStateText = styled('div')<{
  79. size: 'fontSizeExtraLarge' | 'fontSizeMedium';
  80. }>`
  81. color: ${p => p.theme.gray300};
  82. font-size: ${p => p.theme[p.size]};
  83. padding-bottom: ${space(1)};
  84. `;
  85. export const EmptyValueContainer = styled('span')`
  86. color: ${p => p.theme.gray300};
  87. `;
  88. export const SpanPanelContent = styled('div')`
  89. width: 100%;
  90. display: grid;
  91. grid-template-columns: 100px auto repeat(1, min-content) 160px 85px;
  92. `;