Skip to content

Commit bde68f0

Browse files
authored
Add Table style config key, and add v6 table styles (#1104)
1 parent e15d350 commit bde68f0

File tree

6 files changed

+44
-2
lines changed

6 files changed

+44
-2
lines changed

src/table/src/Table.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React, { memo } from 'react'
2+
import { useStyleConfig } from '../../hooks'
23
import { Pane } from '../../layers'
34
import EditableCell from './EditableCell'
45
import SearchTableHeaderCell from './SearchTableHeaderCell'
@@ -12,9 +13,22 @@ import TableVirtualBody from './TableVirtualBody'
1213
import TextTableCell from './TextTableCell'
1314
import TextTableHeaderCell from './TextTableHeaderCell'
1415

16+
const emptyObject = {}
17+
1518
const Table = memo(function Table(props) {
1619
const { children, ...rest } = props
17-
return <Pane {...rest}>{children}</Pane>
20+
const { className, ...boxProps } = useStyleConfig(
21+
'Table',
22+
emptyObject,
23+
emptyObject,
24+
emptyObject
25+
)
26+
27+
return (
28+
<Pane className={className} {...boxProps} {...rest}>
29+
{children}
30+
</Pane>
31+
)
1832
})
1933

2034
Table.Body = TableBody

src/table/stories/EditableTable.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ export default class EditableTable extends React.PureComponent {
9090
onChange={value => this.setState({ isSelectable: value })}
9191
/>
9292
<Pane
93-
border
9493
height="80vh"
9594
display="flex"
9695
flexGrow={0}

src/themes/classic/components/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import Select from './select'
2525
import Spinner from './spinner'
2626
import Switch from './switch'
2727
import Tab from './tab'
28+
import Table from './table'
2829
import TableCell from './table-cell'
2930
import TableHead from './table-head'
3031
import TableRow from './table-row'
@@ -61,6 +62,7 @@ export default {
6162
Spinner,
6263
Switch,
6364
Tab,
65+
Table,
6466
TableCell,
6567
TableHead,
6668
TableRow,
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const baseStyle = {}
2+
3+
const appearances = {}
4+
5+
const sizes = {}
6+
7+
export default {
8+
baseStyle,
9+
appearances,
10+
sizes
11+
}

src/themes/default/components/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import Select from './select'
2525
import Spinner from './spinner'
2626
import Switch from './switch'
2727
import Tab from './tab'
28+
import Table from './table'
2829
import TableCell from './table-cell'
2930
import TableHead from './table-head'
3031
import TableRow from './table-row'
@@ -61,6 +62,7 @@ export default {
6162
Spinner,
6263
Switch,
6364
Tab,
65+
Table,
6466
TableCell,
6567
TableHead,
6668
TableRow,
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const baseStyle = {
2+
borderRadius: 'radii.1',
3+
border: 'muted'
4+
}
5+
6+
const appearances = {}
7+
8+
const sizes = {}
9+
10+
export default {
11+
baseStyle,
12+
appearances,
13+
sizes
14+
}

0 commit comments

Comments
 (0)