-
-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(table,tablebody,tabledatacell,tablehead,tableheadcell,tablerow):…
… convert to TypeScript and export types
- Loading branch information
Showing
19 changed files
with
241 additions
and
262 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React, { forwardRef } from 'react'; | ||
import styled from 'styled-components'; | ||
import { insetShadow } from '../common'; | ||
import { CommonStyledProps } from '../types'; | ||
|
||
type TableBodyProps = { | ||
children?: React.ReactNode; | ||
} & React.HTMLAttributes<HTMLTableSectionElement> & | ||
CommonStyledProps; | ||
|
||
const StyledTableBody = styled.tbody` | ||
background: ${({ theme }) => theme.canvas}; | ||
display: table-row-group; | ||
box-shadow: ${insetShadow}; | ||
overflow-y: auto; | ||
`; | ||
|
||
const TableBody = forwardRef<HTMLTableSectionElement, TableBodyProps>( | ||
function TableBody({ children, ...otherProps }, ref) { | ||
return ( | ||
<StyledTableBody ref={ref} {...otherProps}> | ||
{children} | ||
</StyledTableBody> | ||
); | ||
} | ||
); | ||
|
||
export { TableBody, TableBodyProps }; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import React, { forwardRef } from 'react'; | ||
import styled from 'styled-components'; | ||
import { CommonStyledProps } from '../types'; | ||
|
||
type TableDataCellProps = { | ||
children?: React.ReactNode; | ||
} & React.HTMLAttributes<HTMLTableCellElement> & | ||
CommonStyledProps; | ||
|
||
const StyledTd = styled.td` | ||
padding: 0 8px; | ||
`; | ||
|
||
const TableDataCell = forwardRef<HTMLTableCellElement, TableDataCellProps>( | ||
function TableDataCell({ children, ...otherProps }, ref) { | ||
return ( | ||
<StyledTd ref={ref} {...otherProps}> | ||
{children} | ||
</StyledTd> | ||
); | ||
} | ||
); | ||
|
||
export { TableDataCell, TableDataCellProps }; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React, { forwardRef } from 'react'; | ||
import styled from 'styled-components'; | ||
import { CommonStyledProps } from '../types'; | ||
|
||
type TableHeadProps = { | ||
children?: React.ReactNode; | ||
} & React.HTMLAttributes<HTMLTableSectionElement> & | ||
CommonStyledProps; | ||
|
||
const StyledTableHead = styled.thead` | ||
display: table-header-group; | ||
`; | ||
const TableHead = forwardRef<HTMLTableSectionElement, TableHeadProps>( | ||
function TableHead({ children, ...otherProps }, ref) { | ||
return ( | ||
<StyledTableHead ref={ref} {...otherProps}> | ||
{children} | ||
</StyledTableHead> | ||
); | ||
} | ||
); | ||
|
||
export { TableHead, TableHeadProps }; |
Oops, something went wrong.