Skip to content

Commit

Permalink
feat: disabled animation; updated readme file
Browse files Browse the repository at this point in the history
  • Loading branch information
DenisVershkov committed Dec 4, 2023
1 parent ed45461 commit cee757a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/Tooltip/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {Tooltip} from '@gravity-ui/uikit';
| Name | Description | Type | Default |
| :--------- | --------------------------------------------------------------------------------------- | :----------------------------------------------: | :-----: |
| children | An anchor element for a `Tooltip`. Must accept a `ref` that will provide a DOM element. | `React.ReactElement` | |
| content | Content that will be shown in the `Tooltip` | `React.ReactNode` | |
| content | Content that will be shown in the `Tooltip` | `string` | |
| closeDelay | Number of ms to delay hiding the `Tooltip` after the hover ends | `number` | `0` |
| openDelay | Number of ms to delay showing the `Tooltip` after the hover begins | `number` | `250` |
| placement | `Tooltip` position relative to its anchor | [`PopupPlacement`](../Popup/README.md#placement) | |
7 changes: 4 additions & 3 deletions src/components/Tooltip/Tooltip.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ $block: '.#{variables.$ns}tooltip';
// [class] for increasing specificity
&[class] {
--g-popup-border-width: 0;
--g-popup-background-color: var(--g-color-base-float);

> div {
padding: 4px 8px;
max-width: 360px;
box-sizing: border-box;
box-shadow: 0px 1px 5px 0px rgba(0, 0, 0, 0.15);

animation-duration: unset;
animation-timing-function: unset;
animation-fill-mode: unset;
}
}

Expand All @@ -36,7 +39,5 @@ $block: '.#{variables.$ns}tooltip';

overflow: hidden;
text-overflow: ellipsis;

color: var(--g-color-text-complementary);
}
}
7 changes: 6 additions & 1 deletion src/components/Tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {KeyCode} from '../../constants';
import {useForkRef} from '../../hooks';
import {Popup} from '../Popup';
import type {PopupPlacement} from '../Popup';
import {Text} from '../Text';
import type {DOMProps} from '../types';
import {block} from '../utils/cn';
import {useBoolean} from '../utils/useBoolean';
Expand Down Expand Up @@ -46,7 +47,11 @@ export const Tooltip = (props: TooltipProps) => {
disableOutsideClick
disableLayer
>
<div className={b('content', props.contentClassName)}>{content}</div>
<div className={b('content', props.contentClassName)}>
<Text variant="body-short" color="complementary">
{content}
</Text>
</div>
</Popup>
);
};
Expand Down

0 comments on commit cee757a

Please sign in to comment.