Merged in feat/sw-3247-move-table-to-design-system (pull request #2636)
feat(SW-3247): Move Table component to design-system * Move Table component to design-system Approved-by: Bianca Widstam
This commit is contained in:
41
packages/design-system/lib/components/Table/index.tsx
Normal file
41
packages/design-system/lib/components/Table/index.tsx
Normal file
@@ -0,0 +1,41 @@
|
||||
import TBody from './TBody'
|
||||
import TD from './TD'
|
||||
import TH from './TH'
|
||||
import THead from './THead'
|
||||
import TR from './TR'
|
||||
import { tableVariants } from './variants'
|
||||
|
||||
import type { TableProps } from './table'
|
||||
|
||||
function Table({
|
||||
className,
|
||||
intent,
|
||||
borderRadius,
|
||||
variant,
|
||||
layout,
|
||||
width = '100%',
|
||||
children,
|
||||
...props
|
||||
}: TableProps) {
|
||||
const classNames = tableVariants({
|
||||
className,
|
||||
borderRadius,
|
||||
intent,
|
||||
layout,
|
||||
variant,
|
||||
})
|
||||
|
||||
return (
|
||||
<table className={classNames} style={{ width }} {...props}>
|
||||
{children}
|
||||
</table>
|
||||
)
|
||||
}
|
||||
|
||||
Table.THead = THead
|
||||
Table.TH = TH
|
||||
Table.TBody = TBody
|
||||
Table.TD = TD
|
||||
Table.TR = TR
|
||||
|
||||
export default Table
|
||||
Reference in New Issue
Block a user