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

zendeskgarden / react-components / f3d00f1e-ceae-4d36-ba47-a3042f45e7eb

01 Apr 2024 11:34AM UTC coverage: 96.194%. Remained the same
f3d00f1e-ceae-4d36-ba47-a3042f45e7eb

push

circleci

web-flow
chore(deps): update typescript-eslint monorepo to v7

3321 of 3659 branches covered (90.76%)

Branch coverage included in aggregate %.

10076 of 10268 relevant lines covered (98.13%)

215.9 hits per line

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

70.0
/packages/modals/src/styled/StyledTooltipModal.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 from 'styled-components';
16✔
9
import { Placement } from '@popperjs/core';
10
import { arrowStyles, retrieveComponentStyles, DEFAULT_THEME } from '@zendeskgarden/react-theming';
16✔
11
import { getArrowPosition } from '../utils/gardenPlacements';
16✔
12
import { TransitionStatus } from 'react-transition-group';
13
import { ITooltipModalProps } from '../types';
14

15
const COMPONENT_ID = 'modals.tooltip_modal';
16✔
16

17
export interface IStyledTooltipModalProps
18
  extends Pick<ITooltipModalProps, 'hasArrow' | 'isAnimated'> {
19
  placement: Placement;
20
  transitionState?: TransitionStatus;
21
}
22

23
export const StyledTooltipModal = styled.div.attrs<IStyledTooltipModalProps>(props => ({
106✔
24
  'data-garden-id': COMPONENT_ID,
25
  'data-garden-version': PACKAGE_VERSION,
26
  className: props.isAnimated && 'is-animated'
106!
27
}))<IStyledTooltipModalProps>`
28
  padding: ${props => props.theme.space.base * 5}px;
106✔
29
  width: 400px;
30

31
  ${props => {
32
    const computedArrowStyles = arrowStyles(getArrowPosition(props.placement), {
106✔
33
      size: `${props.theme.space.base * 2}px`,
34
      inset: '1px',
35
      animationModifier: '.is-animated'
36
    });
37

38
    if (props.isAnimated) {
106!
39
      return props.hasArrow && props.transitionState === 'entered' && computedArrowStyles;
×
40
    }
41

42
    return props.hasArrow && computedArrowStyles;
106✔
43
  }};
44

45
  ${props => retrieveComponentStyles(COMPONENT_ID, props)};
106✔
46
`;
47

48
StyledTooltipModal.defaultProps = {
16✔
49
  theme: DEFAULT_THEME
50
};
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