-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: state param for link components * add class filters * fix: support tables * cell stack
- Loading branch information
Showing
11 changed files
with
151 additions
and
18 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { type FC } from "react" | ||
import { | ||
Stack, | ||
TableCell, | ||
type TableCellProps, | ||
type StackProps, | ||
} from "@mui/material" | ||
|
||
export interface CellStackProps extends StackProps { | ||
cellProps?: TableCellProps | ||
} | ||
|
||
const CellStack: FC<CellStackProps> = ({ cellProps, ...stackProps }) => ( | ||
<TableCell {...cellProps}> | ||
<Stack {...stackProps} /> | ||
</TableCell> | ||
) | ||
|
||
export default CellStack |
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,53 @@ | ||
import { type FC, type ReactNode } from "react" | ||
import { | ||
Table as MuiTable, | ||
type TableProps as MuiTableProps, | ||
TableBody, | ||
type TableBodyProps, | ||
TableCell, | ||
type TableCellProps, | ||
TableContainer, | ||
type TableContainerProps, | ||
TableHead, | ||
type TableHeadProps, | ||
TableRow, | ||
type TableRowProps, | ||
} from "@mui/material" | ||
|
||
export interface TableProps extends MuiTableProps { | ||
headers: ReactNode[] | ||
children: ReactNode | ||
containerProps?: TableContainerProps | ||
headProps?: TableHeadProps | ||
headCellProps?: TableCellProps | ||
headRowProps?: TableRowProps | ||
bodyProps?: TableBodyProps | ||
} | ||
|
||
const Table: FC<TableProps> = ({ | ||
headers, | ||
children, | ||
containerProps, | ||
headProps, | ||
headCellProps, | ||
headRowProps, | ||
bodyProps, | ||
...tableProps | ||
}) => ( | ||
<TableContainer {...containerProps}> | ||
<MuiTable {...tableProps}> | ||
<TableHead {...headProps}> | ||
<TableRow {...headRowProps}> | ||
{headers.map((header, index) => ( | ||
<TableCell {...headCellProps} key={`table-head-cell-${index}`}> | ||
{header} | ||
</TableCell> | ||
))} | ||
</TableRow> | ||
</TableHead> | ||
<TableBody {...bodyProps}>{children}</TableBody> | ||
</MuiTable> | ||
</TableContainer> | ||
) | ||
|
||
export default Table |
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,10 @@ | ||
export { default as Table } from "./Table" | ||
export * from "./Table" | ||
export { default as CellStack } from "./CellStack" | ||
export * from "./CellStack" | ||
export { | ||
TableCell as Cell, | ||
type TableCellProps as CellProps, | ||
TableRow as BodyRow, | ||
type TableRowProps as BodyRowProps, | ||
} from "@mui/material" |
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