Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/scaleflex/ui
Browse files Browse the repository at this point in the history
  • Loading branch information
amrelbialy committed Sep 13, 2024
2 parents 6e65805 + 54f88b5 commit 37cee63
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 20 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.10.22](https://github.com/scaleflex/ui/compare/v2.10.21...v2.10.22) (2024-09-11)

### Features

- **TooltipV2:** add isHidden prop ([0899c6e](https://github.com/scaleflex/ui/commit/0899c6e20bdb6c52e6fc7911298a0e2300792380))
- **TooltipV2:** add isHidden prop ([210428e](https://github.com/scaleflex/ui/commit/210428e8d186472910b3f8a3129af63480c162e5))

## [2.10.21](https://github.com/scaleflex/ui/compare/v2.10.20...v2.10.21) (2024-09-10)

### Features
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "2.10.21",
"version": "2.10.22",
"npmClient": "yarn",
"packages": ["packages/*"],
"ignoreChanges": ["**/*.spec.{ts,tsx}", "**/*.story.tsx"],
Expand Down
6 changes: 6 additions & 0 deletions packages/ui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [2.10.22](https://github.com/scaleflex/ui/compare/v2.10.21...v2.10.22) (2024-09-11)

### Features

- **TooltipV2:** add hide prop ([0899c6e](https://github.com/scaleflex/ui/commit/0899c6e20bdb6c52e6fc7911298a0e2300792380))

## [2.10.21](https://github.com/scaleflex/ui/compare/v2.10.20...v2.10.21) (2024-09-10)

### Features
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@scaleflex/ui",
"version": "2.10.21",
"version": "2.10.22",
"description": "React UI components library by Scaleflex Company",
"main": "lib/index.js",
"scripts": {
Expand Down
41 changes: 23 additions & 18 deletions packages/ui/src/core/tooltip-v2/tooltip-v2.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const TooltipV2 = intrinsicComponent<TooltipV2Props, HTMLSpanElement>(
arrow = true,
warning = false,
enableHover = true,
hide = false,
enterDelay = 0,
leaveDelay = 0,
offsetX = 0,
Expand All @@ -26,24 +27,28 @@ const TooltipV2 = intrinsicComponent<TooltipV2Props, HTMLSpanElement>(
...rest
}: TooltipV2Props,
ref
): JSX.Element => (
<Styled.TooltipV2
ref={ref}
placement={position}
content={<Styled.TooltipText>{title}</Styled.TooltipText>}
interactive={enableHover}
arrow={arrow}
delay={[enterDelay, leaveDelay]}
$variant={(warning && Variant.Warning) || (info && Variant.Info) || variant}
$size={size || Size.Sm}
animation="scale"
offset={[offsetX, offsetY]}
appendTo={document.body}
{...rest}
>
{children}
</Styled.TooltipV2>
)
): JSX.Element => {
if (hide) return children;

return (
<Styled.TooltipV2
ref={ref}
placement={position}
content={<Styled.TooltipText>{title}</Styled.TooltipText>}
interactive={enableHover}
arrow={arrow}
delay={[enterDelay, leaveDelay]}
$variant={(warning && Variant.Warning) || (info && Variant.Info) || variant}
$size={size || Size.Sm}
animation="scale"
offset={[offsetX, offsetY]}
appendTo={document.body}
{...rest}
>
{children}
</Styled.TooltipV2>
);
}
);

export default TooltipV2;
1 change: 1 addition & 0 deletions packages/ui/src/core/tooltip-v2/tooltip-v2.props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface TooltipV2Props extends Omit<React.HTMLAttributes<HTMLSpanElemen
enableHover?: boolean;
warning?: boolean;
info?: boolean;
hide?: boolean;
enterDelay?: number;
leaveDelay?: number;
offsetX?: number;
Expand Down
1 change: 1 addition & 0 deletions packages/ui/stories/core/tooltip-v2.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ const defaultArgs = {
arrow: false,
warning: false,
info: false,
hide: false,
enableHover: true,
position: Position.Top,
offsetX: 0,
Expand Down

0 comments on commit 37cee63

Please sign in to comment.