@bitrise/bitkit 12.71.3 → 12.71.5

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitrise/bitkit",
3
3
  "description": "Bitrise React component library",
4
- "version": "12.71.3",
4
+ "version": "12.71.5",
5
5
  "repository": "git@github.com:bitrise-io/bitkit.git",
6
6
  "main": "src/index.ts",
7
7
  "license": "UNLICENSED",
@@ -1,96 +1,98 @@
1
- import type { SystemStyleObject } from '@chakra-ui/theme-tools';
2
1
  import { rem } from '../../utils/utils';
2
+ import { TableProps } from './Table';
3
3
 
4
- const Tabletheme: SystemStyleObject = {
5
- baseStyle: {
6
- caption: {
7
- textAlign: 'left',
8
- marginBottom: '24',
9
- },
10
- captionTitle: {
11
- fontSize: '4',
12
- lineHeight: '1.75rem',
13
- fontWeight: 'bold',
14
- color: 'purple.10',
15
- },
16
- captionDescription: {
17
- marginTop: '4',
18
- color: 'neutral.30',
19
- },
20
- table: {
21
- fontVariantNumeric: 'lining-nums tabular-nums',
22
- borderCollapse: 'separate',
23
- borderRadius: '4',
24
- border: '1px solid',
25
- borderColor: 'neutral.93',
26
- width: '100%',
27
- borderSpacing: 0,
28
- },
29
- thead: {
30
- backgroundColor: 'neutral.93',
31
- borderTopLeftRadius: '4',
32
- borderTopRightRadius: '4',
33
- },
34
- th: {
35
- paddingX: '16',
36
- paddingY: '12',
37
- fontWeight: 'bold',
38
- textAlign: 'left',
39
- whiteSpace: 'nowrap',
40
- },
41
- tooltipContainer: {
42
- display: 'flex',
43
- alignItems: 'center',
44
- gap: 4,
45
- },
46
- sortButton: {
47
- display: 'flex',
48
- gap: '8',
49
- alignItems: 'center',
50
- width: '100%',
51
- paddingX: '16',
52
- paddingY: '12',
53
- fontWeight: 'bold',
54
- textAlign: 'left',
55
- _hover: {
56
- backgroundColor: 'neutral.90',
4
+ const Tabletheme = {
5
+ baseStyle: ({ disableRowHover }: TableProps) => {
6
+ return {
7
+ caption: {
8
+ textAlign: 'left',
9
+ marginBottom: '24',
57
10
  },
58
- },
59
- sortIcon: {
60
- path: {
61
- fill: 'neutral.80',
11
+ captionTitle: {
12
+ fontSize: '4',
13
+ lineHeight: '1.75rem',
14
+ fontWeight: 'bold',
15
+ color: 'purple.10',
62
16
  },
63
- '[aria-sort="none"]:hover & path': {
64
- fill: 'purple.10',
17
+ captionDescription: {
18
+ marginTop: '4',
19
+ color: 'neutral.30',
65
20
  },
66
- '[aria-sort="ascending"] & path:first-of-type': {
67
- fill: 'purple.10',
21
+ table: {
22
+ fontVariantNumeric: 'lining-nums tabular-nums',
23
+ borderCollapse: 'separate',
24
+ borderRadius: '4',
25
+ border: '1px solid',
26
+ borderColor: 'neutral.93',
27
+ width: '100%',
28
+ borderSpacing: 0,
68
29
  },
69
- '[aria-sort="descending"] & path:last-of-type': {
70
- fill: 'purple.10',
30
+ thead: {
31
+ backgroundColor: 'neutral.93',
32
+ borderTopLeftRadius: '4',
33
+ borderTopRightRadius: '4',
71
34
  },
72
- },
73
- tbody: {
74
- tr: {
35
+ th: {
36
+ paddingX: '16',
37
+ paddingY: '12',
38
+ fontWeight: 'bold',
39
+ textAlign: 'left',
40
+ whiteSpace: 'nowrap',
41
+ },
42
+ tooltipContainer: {
43
+ display: 'flex',
44
+ alignItems: 'center',
45
+ gap: 4,
46
+ },
47
+ sortButton: {
48
+ display: 'flex',
49
+ gap: '8',
50
+ alignItems: 'center',
51
+ width: '100%',
52
+ paddingX: '16',
53
+ paddingY: '12',
54
+ fontWeight: 'bold',
55
+ textAlign: 'left',
75
56
  _hover: {
76
- td: { backgroundColor: 'neutral.95' },
57
+ backgroundColor: 'neutral.90',
77
58
  },
78
59
  },
79
- },
80
- td: {
81
- backgroundColor: 'neutral.100',
82
- borderTop: '1px solid',
83
- borderColor: 'neutral.93',
84
- height: rem(65),
85
- paddingX: '16',
86
- paddingY: '8',
87
- textAlign: 'left',
88
- },
89
- expandTd: {
90
- borderBottomColor: 'transparent',
91
- width: '1%',
92
- paddingRight: 0,
93
- },
60
+ sortIcon: {
61
+ path: {
62
+ fill: 'neutral.80',
63
+ },
64
+ '[aria-sort="none"]:hover & path': {
65
+ fill: 'purple.10',
66
+ },
67
+ '[aria-sort="ascending"] & path:first-of-type': {
68
+ fill: 'purple.10',
69
+ },
70
+ '[aria-sort="descending"] & path:last-of-type': {
71
+ fill: 'purple.10',
72
+ },
73
+ },
74
+ tbody: {
75
+ tr: {
76
+ _hover: {
77
+ td: { backgroundColor: !disableRowHover && 'neutral.95' },
78
+ },
79
+ },
80
+ },
81
+ td: {
82
+ backgroundColor: 'neutral.100',
83
+ borderTop: '1px solid',
84
+ borderColor: 'neutral.93',
85
+ height: rem(65),
86
+ paddingX: '16',
87
+ paddingY: '8',
88
+ textAlign: 'left',
89
+ },
90
+ expandTd: {
91
+ borderBottomColor: 'transparent',
92
+ width: '1%',
93
+ paddingRight: 0,
94
+ },
95
+ };
94
96
  },
95
97
  variants: {
96
98
  borderless: {
@@ -3,6 +3,7 @@ import { Table as ChakraTable, TableProps as ChakraTableProps, forwardRef } from
3
3
  export interface TableProps extends ChakraTableProps {
4
4
  isFixed?: boolean;
5
5
  variant?: 'borderless' | 'default';
6
+ disableRowHover?: boolean;
6
7
  }
7
8
 
8
9
  /**
@@ -7,6 +7,7 @@ import {
7
7
  useDisclosure,
8
8
  useTableStyles,
9
9
  } from '@chakra-ui/react';
10
+ import Box from '../Box/Box';
10
11
  import Td from './Td';
11
12
  import TableIconButton from './TableIconButton';
12
13
 
@@ -64,15 +65,11 @@ const Tr = forwardRef<TableRowProps, 'tr'>((props, ref) => {
64
65
  {children}
65
66
  </ChakraTr>
66
67
  <ChakraTr>
67
- <Td
68
- borderColor={isOpen ? undefined : 'transparent'}
69
- colSpan={colSpan}
70
- height="0"
71
- paddingY="0"
72
- transform={isOpen ? 'none' : 'translateY(-1px)'}
73
- >
68
+ <Td colSpan={colSpan} height="0" borderTop="none" padding="0">
74
69
  <Collapse in={isOpen} unmountOnExit>
75
- {expandableContent}
70
+ <Box sx={{ borderTop: css.td.borderTop, borderColor: css.td.borderColor, paddingX: css.td.paddingX }}>
71
+ {expandableContent}
72
+ </Box>
76
73
  </Collapse>
77
74
  </Td>
78
75
  </ChakraTr>