@bitrise/bitkit 12.55.0 → 12.55.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -2,22 +2,23 @@ import { useMultiStyleConfig } from '@chakra-ui/react';
|
|
|
2
2
|
import Popover, { PopoverProps } from '../Popover/Popover';
|
|
3
3
|
import PopoverContent from '../Popover/PopoverContent';
|
|
4
4
|
import PopoverTrigger from '../Popover/PopoverTrigger';
|
|
5
|
-
import Box from '../Box/Box';
|
|
5
|
+
import Box, { BoxProps } from '../Box/Box';
|
|
6
6
|
|
|
7
7
|
export interface DefinitionTooltipProps extends Omit<PopoverProps, 'children'> {
|
|
8
8
|
children: string;
|
|
9
9
|
label: string;
|
|
10
|
+
triggerProps?: BoxProps;
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
const DefinitionTooltip = (props: DefinitionTooltipProps) => {
|
|
13
|
-
const { children, label, ...rest } = props;
|
|
14
|
+
const { children, label, triggerProps, ...rest } = props;
|
|
14
15
|
|
|
15
16
|
const style = useMultiStyleConfig('DefinitionTooltip');
|
|
16
17
|
|
|
17
18
|
return (
|
|
18
19
|
<Popover placement="top" variant="dark" withArrow {...rest}>
|
|
19
20
|
<PopoverTrigger>
|
|
20
|
-
<Box as="button" __css={style.trigger}>
|
|
21
|
+
<Box as="span" role="button" tabIndex={0} __css={style.trigger} {...triggerProps}>
|
|
21
22
|
{children}
|
|
22
23
|
</Box>
|
|
23
24
|
</PopoverTrigger>
|
|
@@ -63,10 +63,10 @@ const Tabletheme: SystemStyleObject = {
|
|
|
63
63
|
'[aria-sort="none"]:hover & path': {
|
|
64
64
|
fill: 'purple.10',
|
|
65
65
|
},
|
|
66
|
-
'[aria-sort="ascending"] & path:first-
|
|
66
|
+
'[aria-sort="ascending"] & path:first-of-type': {
|
|
67
67
|
fill: 'purple.10',
|
|
68
68
|
},
|
|
69
|
-
'[aria-sort="descending"] & path:last-
|
|
69
|
+
'[aria-sort="descending"] & path:last-of-type': {
|
|
70
70
|
fill: 'purple.10',
|
|
71
71
|
},
|
|
72
72
|
},
|
|
@@ -10,7 +10,6 @@ import Icon from '../Icon/Icon';
|
|
|
10
10
|
import DefinitionTooltip, { DefinitionTooltipProps } from '../DefinitionTooltip/DefinitionTooltip';
|
|
11
11
|
|
|
12
12
|
export interface TableColumnHeaderProps extends ChakraTableColumnHeaderProps {
|
|
13
|
-
children?: string;
|
|
14
13
|
isNumeric?: boolean;
|
|
15
14
|
isSortable?: boolean;
|
|
16
15
|
onSortClick?: (sortDirection?: AriaAttributes['aria-sort']) => void;
|
|
@@ -27,11 +26,15 @@ const Th = forwardRef<TableColumnHeaderProps, 'th'>((props, ref) => {
|
|
|
27
26
|
};
|
|
28
27
|
|
|
29
28
|
if (children && tooltip) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
{
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
if (typeof children === 'string') {
|
|
30
|
+
properties.children = (
|
|
31
|
+
<DefinitionTooltip trigger="hover" {...tooltip}>
|
|
32
|
+
{children}
|
|
33
|
+
</DefinitionTooltip>
|
|
34
|
+
);
|
|
35
|
+
} else {
|
|
36
|
+
console.error('If you want to use tooltip on Th, the children should be string.');
|
|
37
|
+
}
|
|
35
38
|
}
|
|
36
39
|
|
|
37
40
|
if (isSortable) {
|