styles.tsx 3.1 KB

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