Skip to content

Commit ae4165a

Browse files
committed
Merge remote-tracking branch 'origin' into fix-alert-dialog-api
2 parents 93dffa8 + ed517ce commit ae4165a

File tree

6 files changed

+46
-13
lines changed

6 files changed

+46
-13
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
# @cube-dev/ui-kit
22

3+
## 0.78.5
4+
5+
### Patch Changes
6+
7+
- [#805](https://github.com/cube-js/cube-ui-kit/pull/805) [`5fa85184`](https://github.com/cube-js/cube-ui-kit/commit/5fa851840db023def82f1a3838576ba8fe0d65f8) Thanks [@tenphi](https://github.com/tenphi)! - Fix the return type of the TooltipProvider the second time :)
8+
9+
- [#805](https://github.com/cube-js/cube-ui-kit/pull/805) [`5fa85184`](https://github.com/cube-js/cube-ui-kit/commit/5fa851840db023def82f1a3838576ba8fe0d65f8) Thanks [@tenphi](https://github.com/tenphi)! - Fix DecimalDecreaseIcon and DecimalIncreaseIcon.
10+
11+
## 0.78.4
12+
13+
### Patch Changes
14+
15+
- [#803](https://github.com/cube-js/cube-ui-kit/pull/803) [`a4f59bb7`](https://github.com/cube-js/cube-ui-kit/commit/a4f59bb74066d1e900fb69ab3215584182a38cb1) Thanks [@tenphi](https://github.com/tenphi)! - Fix the return type of the TooltipProvider the second time :)
16+
17+
## 0.78.3
18+
19+
### Patch Changes
20+
21+
- [#801](https://github.com/cube-js/cube-ui-kit/pull/801) [`fae98647`](https://github.com/cube-js/cube-ui-kit/commit/fae98647f070ac69f6fa7abc80b5bb568896c81a) Thanks [@tenphi](https://github.com/tenphi)! - Fix the return type of TooltipProvider.
22+
323
## 0.78.2
424

525
### Patch Changes

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@cube-dev/ui-kit",
3-
"version": "0.78.2",
3+
"version": "0.78.5",
44
"type": "module",
55
"description": "UIKit for Cube Projects",
66
"repository": {

src/components/overlays/Tooltip/TooltipProvider.tsx

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
import { ReactElement, ReactNode, RefObject, useEffect, useState } from 'react';
1+
import {
2+
isValidElement,
3+
ReactElement,
4+
ReactNode,
5+
RefObject,
6+
useEffect,
7+
useState,
8+
} from 'react';
29

310
import { Styles } from '../../../tasty';
411

@@ -11,13 +18,13 @@ import {
1118

1219
export interface CubeTooltipProviderProps
1320
extends Omit<CubeTooltipTriggerProps, 'children'> {
14-
children: ReactElement | TooltipTriggerFunction;
21+
children: ReactNode | TooltipTriggerFunction;
1522
title?: ReactNode;
1623
tooltipStyles?: Styles;
1724
width?: CubeTooltipProps['width'];
1825
}
1926

20-
export function TooltipProvider(props: CubeTooltipProviderProps) {
27+
export function TooltipProvider(props: CubeTooltipProviderProps): ReactElement {
2128
const [rendered, setRendered] = useState(false);
2229
const { title, children, tooltipStyles, width, ...otherProps } = props;
2330

@@ -29,20 +36,26 @@ export function TooltipProvider(props: CubeTooltipProviderProps) {
2936

3037
// SSR: render without tooltip
3138
if (!rendered) {
32-
return isFunction ? (
39+
return (
3340
<>
34-
{children({}, { current: null } as unknown as RefObject<HTMLElement>)}
41+
{isFunction
42+
? children({}, { current: null } as unknown as RefObject<HTMLElement>)
43+
: children}
3544
</>
36-
) : (
37-
<>{children}</>
38-
);
45+
) as ReactElement;
3946
}
4047

4148
// Both patterns pass through to TooltipTrigger
4249
// The difference is whether we pass function or element as first child
4350
return (
4451
<TooltipTrigger {...otherProps}>
45-
{children}
52+
{isFunction ||
53+
isValidElement(children) ||
54+
typeof children === 'string' ? (
55+
children
56+
) : (
57+
<>{children}</>
58+
)}
4659
<Tooltip styles={tooltipStyles} {...(width ? { width } : null)}>
4760
{title}
4861
</Tooltip>

src/icons/DecimalDecreaseIcon.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const DecimalDecreaseIcon = wrapIcon(
1010
viewBox="0 0 24 24"
1111
>
1212
<path
13-
stroke="#000"
13+
stroke="currentColor"
1414
strokeLinecap="round"
1515
strokeLinejoin="round"
1616
strokeWidth="1.5"

src/icons/DecimalIncreaseIcon.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const DecimalIncreaseIcon = wrapIcon(
1010
viewBox="0 0 24 24"
1111
>
1212
<path
13-
stroke="#000"
13+
stroke="currentColor"
1414
strokeLinecap="round"
1515
strokeLinejoin="round"
1616
strokeWidth="1.5"

src/icons/Icons.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const Template: StoryFn<CubeIconProps> = (name) => {
6161

6262
return (
6363
<Space key={iconName} gap="1x">
64-
<Icon size={24} />
64+
<Icon size={24} color="#purple-text" />
6565
<Text preset="t4">{iconName}</Text>
6666
</Space>
6767
);

0 commit comments

Comments
 (0)