@thecb/components 7.7.3-beta.2 → 7.7.3-beta.4
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 +40 -17
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +78 -27
- package/dist/index.esm.js +40 -17
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/index.d.ts +2 -1
- package/src/components/atoms/table/Table.styled.js +1 -0
- package/src/components/atoms/table/TableCell.styled.js +3 -3
- package/src/components/atoms/table/TableHead.styled.js +1 -1
- package/src/components/atoms/table/TableHeading.styled.js +2 -2
- package/src/components/atoms/table/index.d.ts +50 -0
- package/src/components/molecules/popover/Popover.js +9 -5
- package/src/components/molecules/popover/index.d.ts +3 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from "./card";
|
|
2
1
|
export * from "./button-with-action";
|
|
3
2
|
export * from "./button-with-link";
|
|
3
|
+
export * from "./card";
|
|
4
4
|
export * from "./icons";
|
|
5
5
|
export * from "./layouts";
|
|
6
6
|
export * from "./link";
|
|
@@ -8,5 +8,6 @@ export * from "./nav-footer";
|
|
|
8
8
|
export * from "./nav-header";
|
|
9
9
|
export * from "./nav-tabs";
|
|
10
10
|
export * from "./paragraph";
|
|
11
|
+
export * from "./table";
|
|
11
12
|
export * from "./text";
|
|
12
13
|
export * from "./title";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
2
|
|
|
3
3
|
export default styled.td`
|
|
4
|
-
padding: ${({ padding }) =>
|
|
5
|
-
font-size: 0.875rem
|
|
4
|
+
padding: ${({ padding = "24px" }) => padding};
|
|
5
|
+
font-size: ${({ fontSize = "0.875rem" }) => fontSize}
|
|
6
6
|
white-space: nowrap;
|
|
7
|
-
max-width: 250px;
|
|
7
|
+
max-width: ${({ maxWidth = "250px" }) => maxWidth};
|
|
8
8
|
overflow: hidden;
|
|
9
9
|
text-overflow: ellipsis;
|
|
10
10
|
&:last-child {
|
|
@@ -3,5 +3,5 @@ import styled from "styled-components";
|
|
|
3
3
|
export default styled.thead`
|
|
4
4
|
background-color: ${({ backgroundColor }) => backgroundColor};
|
|
5
5
|
border-bottom: ${({ borderColor }) => `1px solid ${borderColor}`};
|
|
6
|
-
font-size: 0.875rem;
|
|
6
|
+
font-size: ${({ fontSize = "0.875rem" }) => fontSize};
|
|
7
7
|
`;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
2
|
|
|
3
3
|
export default styled.th`
|
|
4
|
-
padding: 24px;
|
|
5
|
-
min-width: ${({ minWidth }) =>
|
|
4
|
+
padding: ${({ padding = "24px" }) => padding};
|
|
5
|
+
min-width: ${({ minWidth = "initial" }) => minWidth};
|
|
6
6
|
text-align: left;
|
|
7
7
|
&:last-child {
|
|
8
8
|
text-align: right;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Expand from "../../../util/expand";
|
|
3
|
+
|
|
4
|
+
export interface TableProps {
|
|
5
|
+
extraStyles?: string;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface TableBodyProps {
|
|
9
|
+
extraStyles?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface TableCellProps {
|
|
13
|
+
extraStyles?: string;
|
|
14
|
+
fontSize?: string;
|
|
15
|
+
maxWidth?: string;
|
|
16
|
+
padding?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface TableHeadProps {
|
|
20
|
+
extraStyles?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface TableHeadingProps {
|
|
23
|
+
extraStyles?: string;
|
|
24
|
+
minWidth?: string;
|
|
25
|
+
padding?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface TableRowProps {
|
|
29
|
+
extraStyles?: string;
|
|
30
|
+
hoverCursor?: boolean;
|
|
31
|
+
hoverEffect?: boolean;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const Table: React.FC<Expand<TableProps> &
|
|
35
|
+
React.HTMLAttributes<HTMLElement>>;
|
|
36
|
+
|
|
37
|
+
export const TableBody: React.FC<Expand<TableBodyProps> &
|
|
38
|
+
React.HTMLAttributes<HTMLElement>>;
|
|
39
|
+
|
|
40
|
+
export const TableCell: React.FC<Expand<TableCellProps> &
|
|
41
|
+
React.HTMLAttributes<HTMLElement>>;
|
|
42
|
+
|
|
43
|
+
export const TableHead: React.FC<Expand<TableHeadProps> &
|
|
44
|
+
React.HTMLAttributes<HTMLElement>>;
|
|
45
|
+
|
|
46
|
+
export const TableHeading: React.FC<Expand<TableHeadingProps> &
|
|
47
|
+
React.HTMLAttributes<HTMLElement>>;
|
|
48
|
+
|
|
49
|
+
export const TableRow: React.FC<Expand<TableRowProps> &
|
|
50
|
+
React.HTMLAttributes<HTMLElement>>;
|
|
@@ -8,9 +8,9 @@ import { useOutsideClick } from "../../../util";
|
|
|
8
8
|
import { noop } from "../../../util/general";
|
|
9
9
|
import { fallbackValues } from "./Popover.theme";
|
|
10
10
|
|
|
11
|
-
const arrowBorder = (direction, width = "8px") => {
|
|
11
|
+
const arrowBorder = (borderColor, direction, width = "8px") => {
|
|
12
12
|
const angle = `${width} solid transparent`;
|
|
13
|
-
const straight = `${width} solid
|
|
13
|
+
const straight = `${width} solid ${borderColor}`;
|
|
14
14
|
if (direction == "down") {
|
|
15
15
|
return `border-left: ${angle}; border-right: ${angle}; border-top: ${straight}`;
|
|
16
16
|
} else if (direction == "up") {
|
|
@@ -40,7 +40,10 @@ const Popover = ({
|
|
|
40
40
|
arrowPosition, // { top: string, right: string, bottom: string, left: string }
|
|
41
41
|
arrowDirection = "down",
|
|
42
42
|
transform = "none",
|
|
43
|
-
buttonExtraStyles
|
|
43
|
+
buttonExtraStyles,
|
|
44
|
+
backgroundColor = "white",
|
|
45
|
+
borderColor = "rgba(255, 255, 255, 0.85)",
|
|
46
|
+
popoverExtraStyles
|
|
44
47
|
}) => {
|
|
45
48
|
const { hoverColor, activeColor, popoverTriggerColor } = themeValues;
|
|
46
49
|
const { top = "-110px", right = "auto", bottom = "auto", left = "-225px" } =
|
|
@@ -110,7 +113,7 @@ const Popover = ({
|
|
|
110
113
|
)}
|
|
111
114
|
</ButtonWithAction>
|
|
112
115
|
<Box
|
|
113
|
-
background=
|
|
116
|
+
background={backgroundColor}
|
|
114
117
|
borderRadius="4px"
|
|
115
118
|
boxShadow="0px 2px 14px 0px rgb(246, 246, 249), 0px 3px 8px 0px rgb(202, 206, 216)"
|
|
116
119
|
id={`Disclosed${popoverID}`}
|
|
@@ -128,6 +131,7 @@ const Popover = ({
|
|
|
128
131
|
left: ${left};
|
|
129
132
|
height: ${height};
|
|
130
133
|
transform: ${transform};
|
|
134
|
+
${popoverExtraStyles};
|
|
131
135
|
`}
|
|
132
136
|
>
|
|
133
137
|
<Paragraph>{content}</Paragraph>
|
|
@@ -138,7 +142,7 @@ const Popover = ({
|
|
|
138
142
|
content: "";
|
|
139
143
|
width: 0;
|
|
140
144
|
height: 0;
|
|
141
|
-
${arrowBorder(arrowDirection, "8px")};
|
|
145
|
+
${arrowBorder(borderColor, arrowDirection, "8px")};
|
|
142
146
|
filter: drop-shadow(2px 8px 14px black);
|
|
143
147
|
bottom: ${arrowBottom};
|
|
144
148
|
right: ${arrowRight};
|
|
@@ -23,6 +23,9 @@ export interface PopoverProps {
|
|
|
23
23
|
arrowDirection?: "left" | "right" | "top" | "bottom";
|
|
24
24
|
transform?: string;
|
|
25
25
|
disclosedExtraStyles?: string;
|
|
26
|
+
borderColor?: string;
|
|
27
|
+
backgroundColor?: string;
|
|
28
|
+
popoverExtraStyles?: string;
|
|
26
29
|
}
|
|
27
30
|
|
|
28
31
|
export const Popover: React.FC<Expand<PopoverProps> &
|