widgetCardPanel.tsx 909 B

123456789101112131415161718192021222324252627282930313233
  1. import styled from '@emotion/styled';
  2. import Panel from 'sentry/components/panels/panel';
  3. import {WidgetCardContextMenuContainer} from 'sentry/views/dashboards/widgetCard/widgetCardContextMenuContainer';
  4. export const WidgetCardPanel = styled(Panel, {
  5. shouldForwardProp: prop => prop !== 'isDragging',
  6. })<{
  7. isDragging: boolean;
  8. }>`
  9. margin: 0;
  10. visibility: ${p => (p.isDragging ? 'hidden' : 'visible')};
  11. /* If a panel overflows due to a long title stretch its grid sibling */
  12. height: 100%;
  13. min-height: 96px;
  14. display: flex;
  15. flex-direction: column;
  16. &:not(:hover):not(:focus-within) {
  17. ${WidgetCardContextMenuContainer} {
  18. opacity: 0;
  19. ${p => p.theme.visuallyHidden}
  20. }
  21. }
  22. :hover {
  23. background-color: ${p => p.theme.surface200};
  24. transition:
  25. background-color 100ms linear,
  26. box-shadow 100ms linear;
  27. box-shadow: ${p => p.theme.dropShadowLight};
  28. }
  29. `;