@bitrise/bitkit 10.23.2 → 10.24.2-alpha-chakra.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 +1 -1
- package/src/Components/Icons/16x16/History.tsx +3 -2
- package/src/Components/Icons/24x24/History.tsx +3 -2
- package/src/Components/Table/Table.stories.tsx +55 -0
- package/src/Components/Table/Table.theme.ts +6 -0
- package/src/Components/Table/Th.tsx +15 -2
- package/src/Components/Text/Text.tsx +1 -1
- package/src/tsconfig.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -3,10 +3,11 @@ import { Icon, IconProps, forwardRef } from '@chakra-ui/react';
|
|
|
3
3
|
const History = forwardRef<IconProps, 'svg'>((props, ref) => (
|
|
4
4
|
<Icon ref={ref} viewBox="0 0 16 16" {...props}>
|
|
5
5
|
<path
|
|
6
|
+
fillRule="evenodd"
|
|
7
|
+
clipRule="evenodd"
|
|
8
|
+
d="M1.36668 8.66667C1.7039 12.0234 4.55826 14.6667 8.00002 14.6667C11.6667 14.6667 14.6667 11.6667 14.6667 8C14.6667 4.33333 11.6667 1.33333 8.00002 1.33333C5.37001 1.33333 3.08299 2.87679 2.00002 5.10263L2.00002 3.33333H0.666687V7.33333L4.66669 7.33333V6H3.05803C3.85332 4.05009 5.77296 2.66667 8.00002 2.66667C10.9334 2.66667 13.3334 5.06667 13.3334 8C13.3334 10.9333 10.9334 13.3333 8.00002 13.3333C5.29235 13.3333 3.03911 11.2884 2.70845 8.66667H1.36668ZM8.26675 9.93333L11.0668 8.6L10.4668 7.4L8.66675 8.26667V4.66667H7.33342V9.33333L8.26675 9.93333Z"
|
|
6
9
|
fill="currentColor"
|
|
7
|
-
d="M1.333 8c0 3.442 2.644 6.296 6 6.633v-1.341C4.712 12.96 2.667 10.708 2.667 8c0-2.933 2.4-5.333 5.333-5.333 2.933 0 5.333 2.4 5.333 5.333 0 2.227-1.383 4.147-3.333 4.942v-1.609H8.667v4h4V14h-1.77c2.226-1.083 3.77-3.37 3.77-6 0-3.667-3-6.667-6.667-6.667S1.333 4.333 1.333 8Z"
|
|
8
10
|
/>
|
|
9
|
-
<path fill="currentColor" d="m11.067 8.6-2.8 1.333-.934-.6V4.667h1.334v3.6l1.8-.867.6 1.2Z" />
|
|
10
11
|
</Icon>
|
|
11
12
|
));
|
|
12
13
|
|
|
@@ -3,10 +3,11 @@ import { Icon, IconProps, forwardRef } from '@chakra-ui/react';
|
|
|
3
3
|
const History = forwardRef<IconProps, 'svg'>((props, ref) => (
|
|
4
4
|
<Icon ref={ref} viewBox="0 0 24 24" {...props}>
|
|
5
5
|
<path
|
|
6
|
-
|
|
6
|
+
fillRule="evenodd"
|
|
7
|
+
clipRule="evenodd"
|
|
8
|
+
d="M2.04999 13C2.55581 18.0351 6.83737 22 12 22C17.5 22 22 17.5 22 12C22 6.5 17.5 2 12 2C8.05498 2 4.62445 4.31518 3 7.65394L3 5L1 5V11H7V9L4.58701 9C5.77995 6.07513 8.6594 4 12 4C16.4 4 20 7.6 20 12C20 16.4 16.4 20 12 20C7.93849 20 4.55863 16.9326 4.06264 13H2.04999ZM12.4001 14.9L16.6001 12.9L15.7001 11.1L13.0001 12.4V7H11.0001V14L12.4001 14.9Z"
|
|
7
9
|
fill="currentColor"
|
|
8
10
|
/>
|
|
9
|
-
<path d="m16.6 12.9-4.2 2L11 14V7h2v5.4l2.7-1.3.9 1.8Z" fill="currentColor" />
|
|
10
11
|
</Icon>
|
|
11
12
|
));
|
|
12
13
|
|
|
@@ -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
|
);
|
|
@@ -46,7 +46,7 @@ export interface TextProps extends ChakraTextProps {
|
|
|
46
46
|
/**
|
|
47
47
|
* Font weight
|
|
48
48
|
*/
|
|
49
|
-
fontWeight?: 'bold' | 'normal';
|
|
49
|
+
fontWeight?: 'bold' | 'normal' | string[];
|
|
50
50
|
/**
|
|
51
51
|
* Size config (https://www.figma.com/file/grik9mTaJ5DfhydhWhXdP5/Bitkit-Foundations?node-id=211%3A12)
|
|
52
52
|
*/
|