@thecb/components 7.7.2 → 7.7.3-beta.2
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/dist/index.cjs.js +175 -51
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +170 -52
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/index.js +1 -0
- package/src/components/atoms/table/Table.styled.js +7 -0
- package/src/components/atoms/table/TableBody.styled.js +5 -0
- package/src/components/atoms/table/TableCell.styled.js +14 -0
- package/src/components/atoms/table/TableHead.js +18 -0
- package/src/components/atoms/table/TableHead.styled.js +7 -0
- package/src/components/atoms/table/TableHead.theme.js +9 -0
- package/src/components/atoms/table/TableHeading.styled.js +11 -0
- package/src/components/atoms/table/TableRow.js +27 -0
- package/src/components/atoms/table/TableRow.styled.js +16 -0
- package/src/components/atoms/table/TableRow.theme.js +9 -0
- package/src/components/atoms/table/index.js +8 -0
package/package.json
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
|
|
3
|
+
export default styled.td`
|
|
4
|
+
padding: ${({ padding }) => (padding ? padding : "24px")};
|
|
5
|
+
font-size: 0.875rem;
|
|
6
|
+
white-space: nowrap;
|
|
7
|
+
max-width: 250px;
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
text-overflow: ellipsis;
|
|
10
|
+
&:last-child {
|
|
11
|
+
text-align: right;
|
|
12
|
+
}
|
|
13
|
+
${({ extraStyles }) => extraStyles};
|
|
14
|
+
`;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { fallbackValues } from "./TableHead.theme";
|
|
3
|
+
import { themeComponent } from "../../../util/themeUtils";
|
|
4
|
+
import StyledTableHead from "./TableHead.styled";
|
|
5
|
+
import TableRow from "./TableRow";
|
|
6
|
+
|
|
7
|
+
const TableHead = ({ children, extraStyles = "", themeValues }) => (
|
|
8
|
+
<StyledTableHead
|
|
9
|
+
backgroundColor={themeValues.backgroundColor}
|
|
10
|
+
borderColor={themeValues.borderColor}
|
|
11
|
+
>
|
|
12
|
+
<TableRow extraStyles={extraStyles} hoverEffect={false}>
|
|
13
|
+
{children}
|
|
14
|
+
</TableRow>
|
|
15
|
+
</StyledTableHead>
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
export default themeComponent(TableHead, "TableHead", fallbackValues);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
|
|
3
|
+
export default styled.th`
|
|
4
|
+
padding: 24px;
|
|
5
|
+
min-width: ${({ minWidth }) => (minWidth ? minWidth : "initial")};
|
|
6
|
+
text-align: left;
|
|
7
|
+
&:last-child {
|
|
8
|
+
text-align: right;
|
|
9
|
+
}
|
|
10
|
+
${({ extraStyles }) => extraStyles}
|
|
11
|
+
`;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { fallbackValues } from "./TableRow.theme";
|
|
3
|
+
import { themeComponent } from "../../../util/themeUtils";
|
|
4
|
+
import TableRowWrapper from "./TableRow.styled";
|
|
5
|
+
|
|
6
|
+
const TableRow = ({
|
|
7
|
+
children,
|
|
8
|
+
extraStyles,
|
|
9
|
+
hoverCursor = false,
|
|
10
|
+
hoverEffect = true,
|
|
11
|
+
onClick,
|
|
12
|
+
themeValues,
|
|
13
|
+
...props
|
|
14
|
+
}) => (
|
|
15
|
+
<TableRowWrapper
|
|
16
|
+
onClick={onClick}
|
|
17
|
+
hoverEffect={hoverEffect}
|
|
18
|
+
extraStyles={extraStyles}
|
|
19
|
+
borderColor={themeValues.borderColor}
|
|
20
|
+
hoverBackgroundColor={themeValues.hoverBackgroundColor}
|
|
21
|
+
{...props}
|
|
22
|
+
>
|
|
23
|
+
{children}
|
|
24
|
+
</TableRowWrapper>
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
export default themeComponent(TableRow, "TableRow", fallbackValues);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
|
|
3
|
+
export default styled.tr`
|
|
4
|
+
&:not(:last-child) {
|
|
5
|
+
border-bottom: ${({ borderColor }) => `1px solid ${borderColor}`};
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
${({ hoverCursor, hoverEffect, hoverBackgroundColor }) =>
|
|
9
|
+
hoverEffect &&
|
|
10
|
+
`&:hover {
|
|
11
|
+
${hoverCursor && "cursor: pointer"};
|
|
12
|
+
background-color: ${hoverBackgroundColor};
|
|
13
|
+
}`}
|
|
14
|
+
|
|
15
|
+
${({ extraStyles }) => extraStyles}
|
|
16
|
+
`;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import Table from "./Table.styled";
|
|
2
|
+
import TableBody from "./TableBody.styled";
|
|
3
|
+
import TableCell from "./TableCell.styled";
|
|
4
|
+
import TableHead from "./TableHead";
|
|
5
|
+
import TableHeading from "./TableHeading.styled";
|
|
6
|
+
import TableRow from "./TableRow";
|
|
7
|
+
|
|
8
|
+
export { Table, TableBody, TableCell, TableHead, TableHeading, TableRow };
|