@bitrise/bitkit 10.23.2 → 10.24.0
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
|
@@ -96,6 +96,61 @@ SortableColumns.args = {
|
|
|
96
96
|
),
|
|
97
97
|
};
|
|
98
98
|
|
|
99
|
+
export const ColumnsWithTooltip = Template.bind({});
|
|
100
|
+
ColumnsWithTooltip.args = {
|
|
101
|
+
children: (
|
|
102
|
+
<>
|
|
103
|
+
<TableCaption description="You have to implelement the logic">Columns with tooltip</TableCaption>
|
|
104
|
+
<Thead>
|
|
105
|
+
<Tr>
|
|
106
|
+
<Th>Name</Th>
|
|
107
|
+
<Th
|
|
108
|
+
isSortable
|
|
109
|
+
tooltip={{
|
|
110
|
+
label:
|
|
111
|
+
'How long successful builds typically take to run. We calculate this using the 50th percentile aggregation.',
|
|
112
|
+
}}
|
|
113
|
+
>
|
|
114
|
+
Typical build time (P50)
|
|
115
|
+
</Th>
|
|
116
|
+
<Th
|
|
117
|
+
isSortable
|
|
118
|
+
sortedBy="descending"
|
|
119
|
+
tooltip={{
|
|
120
|
+
label:
|
|
121
|
+
'How long slowest successful builds take to run. We calculate this using the 90th percentile aggregation.',
|
|
122
|
+
}}
|
|
123
|
+
>
|
|
124
|
+
Typical build time (P90)
|
|
125
|
+
</Th>
|
|
126
|
+
<Th
|
|
127
|
+
isSortable
|
|
128
|
+
tooltip={{ label: 'The total amount of time spent running builds of this app during the selected period.' }}
|
|
129
|
+
>
|
|
130
|
+
Build usage
|
|
131
|
+
</Th>
|
|
132
|
+
<Th isSortable tooltip={{ label: 'The total number of builds during the selected period.' }}>
|
|
133
|
+
Build count
|
|
134
|
+
</Th>
|
|
135
|
+
<Th isSortable tooltip={{ label: 'The percentage of completed builds that passed.' }}>
|
|
136
|
+
Success rate
|
|
137
|
+
</Th>
|
|
138
|
+
</Tr>
|
|
139
|
+
</Thead>
|
|
140
|
+
<Tbody>
|
|
141
|
+
<Tr>
|
|
142
|
+
<Td>bitrise-website</Td>
|
|
143
|
+
<Td>3m 36s</Td>
|
|
144
|
+
<Td>4m 10s</Td>
|
|
145
|
+
<Td>2d 13h 13s</Td>
|
|
146
|
+
<Td>21,433</Td>
|
|
147
|
+
<Td>54.43%</Td>
|
|
148
|
+
</Tr>
|
|
149
|
+
</Tbody>
|
|
150
|
+
</>
|
|
151
|
+
),
|
|
152
|
+
};
|
|
153
|
+
|
|
99
154
|
const onRowClick = () => {};
|
|
100
155
|
|
|
101
156
|
export const ClickableRows = Template.bind({});
|
|
@@ -53,10 +53,16 @@ const Tabletheme: SystemStyleObject = {
|
|
|
53
53
|
textAlign: 'left',
|
|
54
54
|
whiteSpace: 'nowrap',
|
|
55
55
|
},
|
|
56
|
+
tooltipContainer: {
|
|
57
|
+
display: 'flex',
|
|
58
|
+
alignItems: 'center',
|
|
59
|
+
gap: 4,
|
|
60
|
+
},
|
|
56
61
|
sortButton: {
|
|
57
62
|
display: 'flex',
|
|
58
63
|
gap: '8',
|
|
59
64
|
alignItems: 'center',
|
|
65
|
+
justifyContent: 'space-between',
|
|
60
66
|
width: '100%',
|
|
61
67
|
paddingX: '16',
|
|
62
68
|
paddingY: '12',
|
|
@@ -7,21 +7,34 @@ import {
|
|
|
7
7
|
} from '@chakra-ui/react';
|
|
8
8
|
import Box from '../Box/Box';
|
|
9
9
|
import Icon from '../Icon/Icon';
|
|
10
|
+
import Tooltip, { TooltipProps } from '../Tooltip/Tooltip';
|
|
10
11
|
|
|
11
12
|
export interface TableColumnHeaderProps extends ChakraTableColumnHeaderProps {
|
|
12
13
|
isSortable?: boolean;
|
|
13
14
|
onSortClick?: (sortDirection?: AriaAttributes['aria-sort']) => void;
|
|
14
15
|
sortedBy?: AriaAttributes['aria-sort'];
|
|
16
|
+
tooltip?: Omit<TooltipProps, 'children'>;
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
const Th = forwardRef<TableColumnHeaderProps, 'th'>((props, ref) => {
|
|
18
|
-
const { children, isSortable, onSortClick, sortedBy, ...rest } = props;
|
|
20
|
+
const { children, isSortable, onSortClick, sortedBy, tooltip, ...rest } = props;
|
|
19
21
|
const css = useTableStyles();
|
|
20
22
|
const properties: ChakraTableColumnHeaderProps = {
|
|
21
23
|
children,
|
|
22
24
|
...rest,
|
|
23
25
|
};
|
|
24
26
|
|
|
27
|
+
if (tooltip) {
|
|
28
|
+
properties.children = (
|
|
29
|
+
<Box sx={css.tooltipContainer}>
|
|
30
|
+
{children}
|
|
31
|
+
<Tooltip {...tooltip}>
|
|
32
|
+
<Icon color="neutral.50" name="Support" size="16" />
|
|
33
|
+
</Tooltip>
|
|
34
|
+
</Box>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
37
|
+
|
|
25
38
|
if (isSortable) {
|
|
26
39
|
const onClick = () => {
|
|
27
40
|
if (onSortClick) {
|
|
@@ -32,7 +45,7 @@ const Th = forwardRef<TableColumnHeaderProps, 'th'>((props, ref) => {
|
|
|
32
45
|
properties['aria-sort'] = sortedBy || 'none';
|
|
33
46
|
properties.children = (
|
|
34
47
|
<Box as="button" onClick={onClick} sx={css.sortButton}>
|
|
35
|
-
{children}
|
|
48
|
+
{properties.children}
|
|
36
49
|
<Icon name="Sort" sx={css.sortIcon} />
|
|
37
50
|
</Box>
|
|
38
51
|
);
|