• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zendeskgarden / react-components / 16379365509

18 Jul 2025 08:06PM UTC coverage: 95.543%. First build
16379365509

Pull #2006

github

web-flow
Merge bfa591438 into 968211eae
Pull Request #2006: chore(deps): update dependency eslint-config-prettier to v10

3564 of 3984 branches covered (89.46%)

Branch coverage included in aggregate %.

9747 of 9948 relevant lines covered (97.98%)

234.99 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

70.0
/packages/modals/src/styled/StyledTooltipDialog.ts
1
/**
2
 * Copyright Zendesk, Inc.
3
 *
4
 * Use of this source code is governed under the Apache License, Version 2.0
5
 * found at http://www.apache.org/licenses/LICENSE-2.0.
6
 */
7

8
import styled, { DefaultTheme, ThemeProps } from 'styled-components';
16✔
9
import { Placement } from '@floating-ui/react-dom';
10
import { arrowStyles, componentStyles, getArrowPosition } from '@zendeskgarden/react-theming';
16✔
11
import { StyledTooltipDialogClose } from '../styled/StyledTooltipDialogClose';
16✔
12
import { TransitionStatus } from 'react-transition-group';
13

14
const COMPONENT_ID = 'modals.tooltip_dialog';
16✔
15

16
export interface IStyledTooltipDialogProps {
17
  $hasArrow?: boolean;
18
  $isAnimated?: boolean;
19
  $placement: Placement;
20
  $transitionState?: TransitionStatus;
21
}
22

23
const sizeStyles = (props: ThemeProps<DefaultTheme>) => `
104✔
24
  padding: ${props.theme.space.base * 5}px;
25
  width: 400px;
26
  
27
  &:has(${StyledTooltipDialogClose}) > :first-child {
28
    padding-${props.theme.rtl ? 'left' : 'right'}: ${props.theme.space.base * 8}px;
104✔
29
  }
30
`;
31

32
export const StyledTooltipDialog = styled.div.attrs<IStyledTooltipDialogProps>(props => ({
104✔
33
  'data-garden-id': COMPONENT_ID,
34
  'data-garden-version': PACKAGE_VERSION,
35
  className: props.$isAnimated ? 'is-animated' : undefined
104!
36
}))<IStyledTooltipDialogProps>`
37
  ${props => {
38
    const computedArrowStyles = arrowStyles(getArrowPosition(props.theme, props.$placement), {
104✔
39
      size: `${props.theme.space.base * 2}px`,
40
      inset: '1px',
41
      animationModifier: '.is-animated'
42
    });
43

44
    if (props.$isAnimated) {
104!
45
      return props.$hasArrow && props.$transitionState === 'entered' && computedArrowStyles;
×
46
    }
47

48
    return props.$hasArrow && computedArrowStyles;
104✔
49
  }};
50

51
  ${sizeStyles}
52

53
  ${componentStyles};
54
`;
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc