styles.tsx 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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(3, min-content) 95px;
  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`--highlightedSlice-${p.highlightedSliceName}-opacity: 1.0;
  62. --highlightedSlice-${p.highlightedSliceName}-saturate: saturate(1.0) contrast(1.0);
  63. --highlightedSlice-${p.highlightedSliceName}-transform: translateY(0px);
  64. `
  65. : null}
  66. ${p =>
  67. p.highlightedSliceName
  68. ? css`
  69. --defaultSlice-opacity: 1;
  70. --defaultSlice-saturate: saturate(0.7) contrast(0.9) brightness(1.2);
  71. --defaultSlice-transform: translateY(0px);
  72. `
  73. : css`
  74. --defaultSlice-opacity: 1;
  75. --defaultSlice-saturate: saturate(1) contrast(1);
  76. --defaultSlice-transform: translateY(0px);
  77. `}
  78. `;
  79. export const EmptyStateText = styled('div')<{
  80. size: 'fontSizeExtraLarge' | 'fontSizeMedium';
  81. }>`
  82. color: ${p => p.theme.gray300};
  83. font-size: ${p => p.theme[p.size]};
  84. padding-bottom: ${space(1)};
  85. `;
  86. export const EmptyValueContainer = styled('span')`
  87. color: ${p => p.theme.gray300};
  88. `;
  89. export const SpanPanelContent = styled('div')`
  90. width: 100%;
  91. display: grid;
  92. grid-template-columns: 100px auto repeat(1, min-content) 100px 75px;
  93. `;