@bitrise/bitkit 10.12.1 → 10.13.0-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/Avatar/Avatar.tsx +3 -0
- package/src/Components/Table/SortIcon.tsx +10 -0
- package/src/Components/Table/Table.stories.tsx +154 -0
- package/src/Components/Table/Table.theme.ts +99 -0
- package/src/Components/Table/Table.tsx +22 -0
- package/src/Components/Table/TableCaption.tsx +27 -0
- package/src/Components/Table/TableContainer.tsx +9 -0
- package/src/Components/Table/Tbody.tsx +9 -0
- package/src/Components/Table/Td.tsx +22 -0
- package/src/Components/Table/Th.tsx +45 -0
- package/src/Components/Table/Thead.tsx +9 -0
- package/src/Components/Table/Tr.tsx +61 -0
- package/src/index.ts +24 -0
- package/src/old.ts +14 -14
- package/src/theme.ts +3 -1
- package/src/tsconfig.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Icon, IconProps, forwardRef } from '@chakra-ui/react';
|
|
2
|
+
|
|
3
|
+
const SortIcon = forwardRef<IconProps, 'svg'>((props, ref) => (
|
|
4
|
+
<Icon ref={ref} viewBox="0 0 24 24" width="24" height="24" {...props}>
|
|
5
|
+
<path d="M7.68341 9.17991L11.6159 4.46093C11.8158 4.22105 12.1842 4.22106 12.3841 4.46093L16.3166 9.17991C16.588 9.50557 16.3564 10 15.9325 10H8.06752C7.6436 10 7.41203 9.50557 7.68341 9.17991Z" />
|
|
6
|
+
<path d="M16.3166 14.8201L12.3841 19.5391C12.1842 19.7789 11.8158 19.7789 11.6159 19.5391L7.68341 14.8201C7.41203 14.4944 7.6436 14 8.06752 14L15.9325 14C16.3564 14 16.588 14.4944 16.3166 14.8201Z" />
|
|
7
|
+
</Icon>
|
|
8
|
+
));
|
|
9
|
+
|
|
10
|
+
export default SortIcon;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
2
|
+
import Box from '../Box/Box';
|
|
3
|
+
import Table from './Table';
|
|
4
|
+
import TableContainer from './TableContainer';
|
|
5
|
+
import Th from './Th';
|
|
6
|
+
import Thead from './Thead';
|
|
7
|
+
import Tbody from './Tbody';
|
|
8
|
+
import Tr from './Tr';
|
|
9
|
+
import Td from './Td';
|
|
10
|
+
import TableCaption from './TableCaption';
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
title: 'Components/Table',
|
|
14
|
+
component: Table,
|
|
15
|
+
args: {
|
|
16
|
+
isFixed: false,
|
|
17
|
+
},
|
|
18
|
+
} as ComponentMeta<typeof Table>;
|
|
19
|
+
|
|
20
|
+
const Template: ComponentStory<typeof Table> = (props) => (
|
|
21
|
+
<TableContainer>
|
|
22
|
+
<Table {...props} />
|
|
23
|
+
</TableContainer>
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
export const BasicVersion = Template.bind({});
|
|
27
|
+
BasicVersion.args = {
|
|
28
|
+
children: (
|
|
29
|
+
<>
|
|
30
|
+
<TableCaption description="Table decription">Basic Table</TableCaption>
|
|
31
|
+
<Thead>
|
|
32
|
+
<Tr>
|
|
33
|
+
<Th>To convert</Th>
|
|
34
|
+
<Th>into</Th>
|
|
35
|
+
<Th textAlign="right">multiply by</Th>
|
|
36
|
+
</Tr>
|
|
37
|
+
</Thead>
|
|
38
|
+
<Tbody>
|
|
39
|
+
<Tr>
|
|
40
|
+
<Td>inches</Td>
|
|
41
|
+
<Td>millimetres (mm)</Td>
|
|
42
|
+
<Td textAlign="right">25.4</Td>
|
|
43
|
+
</Tr>
|
|
44
|
+
<Tr>
|
|
45
|
+
<Td colSpan={3} textAlign="right" variant="separator">
|
|
46
|
+
Separator
|
|
47
|
+
</Td>
|
|
48
|
+
</Tr>
|
|
49
|
+
<Tr>
|
|
50
|
+
<Td>feet</Td>
|
|
51
|
+
<Td>centimetres (cm)</Td>
|
|
52
|
+
<Td textAlign="right">30.48</Td>
|
|
53
|
+
</Tr>
|
|
54
|
+
<Tr>
|
|
55
|
+
<Td>yards</Td>
|
|
56
|
+
<Td>metres (m)</Td>
|
|
57
|
+
<Td textAlign="right">0.91444</Td>
|
|
58
|
+
</Tr>
|
|
59
|
+
</Tbody>
|
|
60
|
+
</>
|
|
61
|
+
),
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const SortableColumns = Template.bind({});
|
|
65
|
+
SortableColumns.args = {
|
|
66
|
+
children: (
|
|
67
|
+
<>
|
|
68
|
+
<TableCaption description="You have to implelement the logic">Sortable columns</TableCaption>
|
|
69
|
+
<Thead>
|
|
70
|
+
<Tr>
|
|
71
|
+
<Th isSortable>isSortable: true</Th>
|
|
72
|
+
<Th isSortable sortedBy="ascending">
|
|
73
|
+
sortedBy: ascending
|
|
74
|
+
</Th>
|
|
75
|
+
<Th isSortable sortedBy="descending">
|
|
76
|
+
sortedBy: descending
|
|
77
|
+
</Th>
|
|
78
|
+
<Th>isSortable: false</Th>
|
|
79
|
+
</Tr>
|
|
80
|
+
</Thead>
|
|
81
|
+
<Tbody>
|
|
82
|
+
<Tr>
|
|
83
|
+
<Td>1</Td>
|
|
84
|
+
<Td>foo</Td>
|
|
85
|
+
<Td>bar</Td>
|
|
86
|
+
<Td>baz</Td>
|
|
87
|
+
</Tr>
|
|
88
|
+
<Tr>
|
|
89
|
+
<Td>2</Td>
|
|
90
|
+
<Td>foo</Td>
|
|
91
|
+
<Td>bar</Td>
|
|
92
|
+
<Td>baz</Td>
|
|
93
|
+
</Tr>
|
|
94
|
+
</Tbody>
|
|
95
|
+
</>
|
|
96
|
+
),
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const onRowClick = () => {};
|
|
100
|
+
|
|
101
|
+
export const ClickableRows = Template.bind({});
|
|
102
|
+
ClickableRows.args = {
|
|
103
|
+
children: (
|
|
104
|
+
<>
|
|
105
|
+
<TableCaption description="You can add onClick to the Tr">
|
|
106
|
+
Clickable rows - This is a temporary solution, please use it only when it really necessary
|
|
107
|
+
</TableCaption>
|
|
108
|
+
<Thead>
|
|
109
|
+
<Tr>
|
|
110
|
+
<Th>Workflow</Th>
|
|
111
|
+
</Tr>
|
|
112
|
+
</Thead>
|
|
113
|
+
<Tbody>
|
|
114
|
+
<Tr onClick={onRowClick}>
|
|
115
|
+
<Td>ci-rspec-apps</Td>
|
|
116
|
+
</Tr>
|
|
117
|
+
<Tr onClick={onRowClick}>
|
|
118
|
+
<Td>ci-rspes</Td>
|
|
119
|
+
</Tr>
|
|
120
|
+
<Tr onClick={onRowClick}>
|
|
121
|
+
<Td>ci-be-lint</Td>
|
|
122
|
+
</Tr>
|
|
123
|
+
</Tbody>
|
|
124
|
+
</>
|
|
125
|
+
),
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
export const ExpandableRows = Template.bind({});
|
|
129
|
+
ExpandableRows.args = {
|
|
130
|
+
children: (
|
|
131
|
+
<>
|
|
132
|
+
<TableCaption description="Click on a row">Expandable rows</TableCaption>
|
|
133
|
+
<Thead>
|
|
134
|
+
<Tr>
|
|
135
|
+
<Th colSpan={2}>ID</Th>
|
|
136
|
+
<Th>Status</Th>
|
|
137
|
+
<Th>Time</Th>
|
|
138
|
+
</Tr>
|
|
139
|
+
</Thead>
|
|
140
|
+
<Tbody>
|
|
141
|
+
<Tr expandableContent={<Box paddingY="12">😎</Box>}>
|
|
142
|
+
<Td>f6963af857c8f2fe</Td>
|
|
143
|
+
<Td>Success</Td>
|
|
144
|
+
<Td>May 29, 2022 10:11:32am</Td>
|
|
145
|
+
</Tr>
|
|
146
|
+
<Tr expandableContent={<Box paddingY="12">🥳</Box>}>
|
|
147
|
+
<Td>f6963af857c8f2fe</Td>
|
|
148
|
+
<Td>Aborted</Td>
|
|
149
|
+
<Td>May 29, 2022 9:12:50am</Td>
|
|
150
|
+
</Tr>
|
|
151
|
+
</Tbody>
|
|
152
|
+
</>
|
|
153
|
+
),
|
|
154
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import type { SystemStyleObject } from '@chakra-ui/theme-tools';
|
|
2
|
+
|
|
3
|
+
export const separatorStyle: SystemStyleObject = {
|
|
4
|
+
backgroundColor: 'neutral.93',
|
|
5
|
+
color: 'neutral.50',
|
|
6
|
+
fontSize: '1',
|
|
7
|
+
fontWeight: 'bold',
|
|
8
|
+
lineHeight: '1',
|
|
9
|
+
textTransform: 'uppercase',
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const Tabletheme: SystemStyleObject = {
|
|
13
|
+
baseStyle: {
|
|
14
|
+
caption: {
|
|
15
|
+
textAlign: 'left',
|
|
16
|
+
marginBottom: '24',
|
|
17
|
+
},
|
|
18
|
+
captionTitle: {
|
|
19
|
+
fontSize: '4',
|
|
20
|
+
lineHeight: '4',
|
|
21
|
+
fontWeight: 'bold',
|
|
22
|
+
color: 'purple.10',
|
|
23
|
+
},
|
|
24
|
+
captionDescription: {
|
|
25
|
+
marginTop: '4',
|
|
26
|
+
color: 'neutral.30',
|
|
27
|
+
},
|
|
28
|
+
table: {
|
|
29
|
+
fontVariantNumeric: 'lining-nums tabular-nums',
|
|
30
|
+
borderCollapse: 'separate',
|
|
31
|
+
borderRadius: '4',
|
|
32
|
+
border: '1px solid',
|
|
33
|
+
borderColor: 'neutral.93',
|
|
34
|
+
width: '100%',
|
|
35
|
+
borderSpacing: 0,
|
|
36
|
+
borderBottom: 0,
|
|
37
|
+
},
|
|
38
|
+
thead: {
|
|
39
|
+
backgroundColor: 'neutral.93',
|
|
40
|
+
borderTopLeftRadius: '4',
|
|
41
|
+
borderTopRightRadius: '4',
|
|
42
|
+
},
|
|
43
|
+
clickableTr: {
|
|
44
|
+
cursor: 'pointer',
|
|
45
|
+
_hover: {
|
|
46
|
+
backgroundColor: 'neutral.95',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
th: {
|
|
50
|
+
paddingX: '16',
|
|
51
|
+
paddingY: '12',
|
|
52
|
+
fontWeight: 'bold',
|
|
53
|
+
textAlign: 'left',
|
|
54
|
+
},
|
|
55
|
+
sortButton: {
|
|
56
|
+
display: 'flex',
|
|
57
|
+
gap: '8',
|
|
58
|
+
alignItems: 'center',
|
|
59
|
+
width: '100%',
|
|
60
|
+
paddingX: '16',
|
|
61
|
+
paddingY: '12',
|
|
62
|
+
fontWeight: 'bold',
|
|
63
|
+
textAlign: 'left',
|
|
64
|
+
_hover: {
|
|
65
|
+
backgroundColor: 'neutral.90',
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
sortIcon: {
|
|
69
|
+
path: {
|
|
70
|
+
fill: 'neutral.80',
|
|
71
|
+
},
|
|
72
|
+
'[aria-sort="none"]:hover & path': {
|
|
73
|
+
fill: 'purple.10',
|
|
74
|
+
},
|
|
75
|
+
'[aria-sort="ascending"] & path:first-child': {
|
|
76
|
+
fill: 'purple.10',
|
|
77
|
+
},
|
|
78
|
+
'[aria-sort="descending"] & path:last-child': {
|
|
79
|
+
fill: 'purple.10',
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
td: {
|
|
83
|
+
borderBottom: '1px solid',
|
|
84
|
+
borderColor: 'neutral.93',
|
|
85
|
+
paddingX: '16',
|
|
86
|
+
paddingY: '12',
|
|
87
|
+
textAlign: 'left',
|
|
88
|
+
},
|
|
89
|
+
expandTd: {
|
|
90
|
+
borderBottomColor: 'transparent',
|
|
91
|
+
width: '1%',
|
|
92
|
+
'+ td': {
|
|
93
|
+
paddingLeft: 0,
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export default Tabletheme;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Table as ChakraTable, TableProps as ChakraTableProps, forwardRef } from '@chakra-ui/react';
|
|
2
|
+
|
|
3
|
+
export interface TableProps extends ChakraTableProps {
|
|
4
|
+
isFixed?: boolean;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Table component is used to organize and display data efficiently. It renders a `<table>` element.
|
|
9
|
+
*/
|
|
10
|
+
const Table = forwardRef<TableProps, 'table'>((props, ref) => {
|
|
11
|
+
const { isFixed, ...rest } = props;
|
|
12
|
+
|
|
13
|
+
const properties: ChakraTableProps = {
|
|
14
|
+
sx: {
|
|
15
|
+
tableLayout: isFixed ? 'fixed' : 'auto',
|
|
16
|
+
},
|
|
17
|
+
...rest,
|
|
18
|
+
};
|
|
19
|
+
return <ChakraTable {...properties} ref={ref} />;
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export default Table;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
TableCaption as ChakraTableCaption,
|
|
3
|
+
TableCaptionProps as ChakraTableCaptionProps,
|
|
4
|
+
forwardRef,
|
|
5
|
+
useTableStyles,
|
|
6
|
+
} from '@chakra-ui/react';
|
|
7
|
+
import Text from '../Text/Text';
|
|
8
|
+
|
|
9
|
+
export interface TableCaptionProps extends Omit<ChakraTableCaptionProps, 'placement'> {
|
|
10
|
+
description?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const TableCaption = forwardRef<TableCaptionProps, 'caption'>((props, ref) => {
|
|
14
|
+
const { children, description } = props;
|
|
15
|
+
const css = useTableStyles();
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<ChakraTableCaption {...props} placement="top" ref={ref}>
|
|
19
|
+
<Text as="h5" sx={css.captionTitle}>
|
|
20
|
+
{children}
|
|
21
|
+
</Text>
|
|
22
|
+
{!!description && <Text sx={css.captionDescription}>{description}</Text>}
|
|
23
|
+
</ChakraTableCaption>
|
|
24
|
+
);
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export default TableCaption;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TableContainer as ChakraTableContainer, TableContainerProps, forwardRef } from '@chakra-ui/react';
|
|
2
|
+
|
|
3
|
+
const TableContainer = forwardRef<TableContainerProps, 'tbody'>((props, ref) => {
|
|
4
|
+
return <ChakraTableContainer {...props} ref={ref} />;
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
export type { TableContainerProps };
|
|
8
|
+
|
|
9
|
+
export default TableContainer;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Tbody as ChakraTbody, TableBodyProps, forwardRef } from '@chakra-ui/react';
|
|
2
|
+
|
|
3
|
+
const Tbody = forwardRef<TableBodyProps, 'div'>((props, ref) => {
|
|
4
|
+
return <ChakraTbody {...props} ref={ref} />;
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
export type { TableBodyProps };
|
|
8
|
+
|
|
9
|
+
export default Tbody;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Td as ChakraTd, TableCellProps as ChakraTableCellProps, forwardRef } from '@chakra-ui/react';
|
|
2
|
+
import { separatorStyle } from './Table.theme';
|
|
3
|
+
|
|
4
|
+
export interface TableCellProps extends ChakraTableCellProps {
|
|
5
|
+
variant?: 'default' | 'separator';
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
const VARIANTS = {
|
|
9
|
+
default: {},
|
|
10
|
+
separator: separatorStyle,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const Td = forwardRef<TableCellProps, 'td'>((props, ref) => {
|
|
14
|
+
const { variant, ...rest } = props;
|
|
15
|
+
const properties: ChakraTableCellProps = {
|
|
16
|
+
sx: VARIANTS[variant || 'default'],
|
|
17
|
+
...rest,
|
|
18
|
+
};
|
|
19
|
+
return <ChakraTd role="cell" {...properties} ref={ref} />;
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export default Td;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Th as ChakraTh,
|
|
3
|
+
TableColumnHeaderProps as ChakraTableColumnHeaderProps,
|
|
4
|
+
forwardRef,
|
|
5
|
+
useTableStyles,
|
|
6
|
+
} from '@chakra-ui/react';
|
|
7
|
+
import Box from '../Box/Box';
|
|
8
|
+
import SortIcon from './SortIcon';
|
|
9
|
+
|
|
10
|
+
type SortType = 'ascending' | 'descending' | undefined;
|
|
11
|
+
|
|
12
|
+
export interface TableColumnHeaderProps extends ChakraTableColumnHeaderProps {
|
|
13
|
+
isSortable?: boolean;
|
|
14
|
+
onSortClick?: (sortDirection?: SortType) => void;
|
|
15
|
+
sortedBy?: SortType;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const Th = forwardRef<TableColumnHeaderProps, 'th'>((props, ref) => {
|
|
19
|
+
const { children, isSortable, onSortClick, sortedBy, ...rest } = props;
|
|
20
|
+
const css = useTableStyles();
|
|
21
|
+
const properties: ChakraTableColumnHeaderProps = {
|
|
22
|
+
children,
|
|
23
|
+
...rest,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
if (isSortable) {
|
|
27
|
+
const onClick = () => {
|
|
28
|
+
if (onSortClick) {
|
|
29
|
+
onSortClick(sortedBy);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
properties.padding = '0';
|
|
33
|
+
properties['aria-sort'] = sortedBy || 'none';
|
|
34
|
+
properties.children = (
|
|
35
|
+
<Box as="button" onClick={onClick} sx={css.sortButton}>
|
|
36
|
+
{children}
|
|
37
|
+
<SortIcon sx={css.sortIcon} />
|
|
38
|
+
</Box>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return <ChakraTh {...properties} ref={ref} />;
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export default Th;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Thead as ChakraThead, TableHeadProps, forwardRef } from '@chakra-ui/react';
|
|
2
|
+
|
|
3
|
+
const Thead = forwardRef<TableHeadProps, 'thead'>((props, ref) => {
|
|
4
|
+
return <ChakraThead {...props} ref={ref} />;
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
export type { TableHeadProps };
|
|
8
|
+
|
|
9
|
+
export default Thead;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Children, ReactNode } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Collapse,
|
|
4
|
+
Tr as ChakraTr,
|
|
5
|
+
TableRowProps as ChakraTableRowProps,
|
|
6
|
+
forwardRef,
|
|
7
|
+
useDisclosure,
|
|
8
|
+
useTableStyles,
|
|
9
|
+
} from '@chakra-ui/react';
|
|
10
|
+
import Icon from '../Icon/Icon';
|
|
11
|
+
import Td from './Td';
|
|
12
|
+
|
|
13
|
+
export interface TableRowProps extends ChakraTableRowProps {
|
|
14
|
+
expandableContent?: ReactNode | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* @deprecated - Please use it only when really necessary, we are working on a new table-like components with clickable items
|
|
17
|
+
*/
|
|
18
|
+
onClick?: ChakraTableRowProps['onClick'];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const Tr = forwardRef<TableRowProps, 'tr'>((props, ref) => {
|
|
22
|
+
const { isOpen, onToggle } = useDisclosure();
|
|
23
|
+
const css = useTableStyles();
|
|
24
|
+
|
|
25
|
+
const { children, expandableContent, onClick, ...rest } = props;
|
|
26
|
+
const properties: ChakraTableRowProps = {
|
|
27
|
+
onClick,
|
|
28
|
+
...rest,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
if (expandableContent || onClick) {
|
|
32
|
+
properties.role = 'button';
|
|
33
|
+
properties.sx = css.clickableTr;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (expandableContent) {
|
|
37
|
+
const colSpan = Children.count(children) + 1;
|
|
38
|
+
return (
|
|
39
|
+
<>
|
|
40
|
+
<ChakraTr {...properties} ref={ref} onClick={onToggle}>
|
|
41
|
+
<Td sx={css.expandTd}>
|
|
42
|
+
<Icon name="ChevronDown" transform={isOpen ? 'rotate(-180deg)' : 'rotate(0deg)'} transition="300ms" />
|
|
43
|
+
</Td>
|
|
44
|
+
{children}
|
|
45
|
+
</ChakraTr>
|
|
46
|
+
<ChakraTr>
|
|
47
|
+
<Td colSpan={colSpan} paddingY="0" transform={isOpen ? 'none' : 'translateY(-1px)'}>
|
|
48
|
+
<Collapse in={isOpen}>{expandableContent}</Collapse>
|
|
49
|
+
</Td>
|
|
50
|
+
</ChakraTr>
|
|
51
|
+
</>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
return (
|
|
55
|
+
<ChakraTr {...properties} ref={ref}>
|
|
56
|
+
{children}
|
|
57
|
+
</ChakraTr>
|
|
58
|
+
);
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
export default Tr;
|
package/src/index.ts
CHANGED
|
@@ -159,3 +159,27 @@ export { default as Accordion } from './Components/Accordion/Accordion';
|
|
|
159
159
|
|
|
160
160
|
export type { AccordionItemProps } from './Components/Accordion/AccordionItem';
|
|
161
161
|
export { default as AccordionItem } from './Components/Accordion/AccordionItem';
|
|
162
|
+
|
|
163
|
+
export type { TableProps } from './Components/Table/Table';
|
|
164
|
+
export { default as Table } from './Components/Table/Table';
|
|
165
|
+
|
|
166
|
+
export type { TableCaptionProps } from './Components/Table/TableCaption';
|
|
167
|
+
export { default as TableCaption } from './Components/Table/TableCaption';
|
|
168
|
+
|
|
169
|
+
export type { TableContainerProps } from './Components/Table/TableContainer';
|
|
170
|
+
export { default as TableContainer } from './Components/Table/TableContainer';
|
|
171
|
+
|
|
172
|
+
export type { TableBodyProps } from './Components/Table/Tbody';
|
|
173
|
+
export { default as Tbody } from './Components/Table/Tbody';
|
|
174
|
+
|
|
175
|
+
export type { TableCellProps } from './Components/Table/Td';
|
|
176
|
+
export { default as Td } from './Components/Table/Td';
|
|
177
|
+
|
|
178
|
+
export type { TableColumnHeaderProps } from './Components/Table/Th';
|
|
179
|
+
export { default as Th } from './Components/Table/Th';
|
|
180
|
+
|
|
181
|
+
export type { TableHeadProps } from './Components/Table/Thead';
|
|
182
|
+
export { default as Thead } from './Components/Table/Thead';
|
|
183
|
+
|
|
184
|
+
export type { TableRowProps } from './Components/Table/Tr';
|
|
185
|
+
export { default as Tr } from './Components/Table/Tr';
|
package/src/old.ts
CHANGED
|
@@ -72,27 +72,27 @@ export { default as SkeletonBox } from './Old/Skeleton/SkeletonBox';
|
|
|
72
72
|
export type { Props as Status500Props } from './Old/Status/Status500';
|
|
73
73
|
export { default as Status500 } from './Old/Status/Status500';
|
|
74
74
|
|
|
75
|
-
export type { Props as
|
|
76
|
-
export { default as
|
|
75
|
+
export type { Props as OldTableProps } from './Old/Table/Table';
|
|
76
|
+
export { default as OldTable } from './Old/Table/Table';
|
|
77
77
|
|
|
78
|
-
export type { Props as
|
|
79
|
-
export { default as
|
|
78
|
+
export type { Props as OldTableBodyProps } from './Old/Table/TableBody';
|
|
79
|
+
export { default as OldTableBody } from './Old/Table/TableBody';
|
|
80
80
|
|
|
81
|
-
export type { Props as
|
|
82
|
-
export { default as
|
|
81
|
+
export type { Props as OldTableCellProps } from './Old/Table/TableCell';
|
|
82
|
+
export { default as OldTableCell } from './Old/Table/TableCell';
|
|
83
83
|
|
|
84
|
-
export type { Props as
|
|
85
|
-
export { default as
|
|
84
|
+
export type { Props as OldTableHeaderProps } from './Old/Table/TableHeader';
|
|
85
|
+
export { default as OldTableHeader } from './Old/Table/TableHeader';
|
|
86
86
|
|
|
87
|
-
export type { Props as
|
|
87
|
+
export type { Props as OldTableHeaderCellProps } from './Old/Table/TableHeaderCell';
|
|
88
88
|
export type { TypeTableSort } from './Old/Table/TableHeaderCell';
|
|
89
|
-
export { default as
|
|
89
|
+
export { default as OldTableHeaderCell } from './Old/Table/TableHeaderCell';
|
|
90
90
|
|
|
91
|
-
export type { Props as
|
|
92
|
-
export { default as
|
|
91
|
+
export type { Props as OldTableHeaderRowProps } from './Old/Table/TableHeaderRow';
|
|
92
|
+
export { default as OldTableHeaderRow } from './Old/Table/TableHeaderRow';
|
|
93
93
|
|
|
94
|
-
export type { Props as
|
|
95
|
-
export { default as
|
|
94
|
+
export type { Props as OldTableRowProps } from './Old/Table/TableRow';
|
|
95
|
+
export { default as OldTableRow } from './Old/Table/TableRow';
|
|
96
96
|
|
|
97
97
|
export type { Props as TextareaProps } from './Old/Textarea/Textarea';
|
|
98
98
|
export { default as Textarea } from './Old/Textarea/Textarea';
|
package/src/theme.ts
CHANGED
|
@@ -18,6 +18,7 @@ import Input from './Components/Input/Input.theme';
|
|
|
18
18
|
import Dropdown from './Components/Dropdown/Dropdown.theme';
|
|
19
19
|
import Tabs from './Components/Tabs/Tabs.theme';
|
|
20
20
|
import Text from './Components/Text/Text.theme';
|
|
21
|
+
import Table from './Components/Table/Table.theme';
|
|
21
22
|
import Alert from './Foundations/Themes/Alert.theme';
|
|
22
23
|
import Tooltip from './Components/Tooltip/Tooltip.theme';
|
|
23
24
|
import CloseButton from './Components/CloseButton/CloseButton.theme';
|
|
@@ -76,6 +77,7 @@ const theme = {
|
|
|
76
77
|
Checkbox,
|
|
77
78
|
ColorButton,
|
|
78
79
|
Divider,
|
|
80
|
+
Dropdown,
|
|
79
81
|
EmptyState,
|
|
80
82
|
Link,
|
|
81
83
|
List,
|
|
@@ -83,7 +85,7 @@ const theme = {
|
|
|
83
85
|
Modal: Dialog,
|
|
84
86
|
Radio,
|
|
85
87
|
Select,
|
|
86
|
-
|
|
88
|
+
Table,
|
|
87
89
|
Tabs,
|
|
88
90
|
Text,
|
|
89
91
|
Tooltip,
|