@thecb/components 6.3.1-beta.7 → 6.3.1-beta.8
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 +37 -27
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +24 -2
- package/dist/index.esm.js +37 -27
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/button-with-action/index.d.ts +1 -1
- package/src/components/atoms/card/Card.js +15 -12
- package/src/components/atoms/card/CardHeader.js +5 -4
- package/src/components/atoms/card/CardText.js +2 -1
- package/src/components/atoms/card/CardText.theme.js +1 -1
- package/src/components/atoms/card/index.d.ts +2 -0
- package/src/components/molecules/collapsible-section/index.d.ts +22 -0
- package/src/components/molecules/editable-table/index.d.ts +24 -0
- package/src/components/molecules/index.d.ts +1 -0
package/package.json
CHANGED
|
@@ -5,7 +5,6 @@ import withWindowSize from "../../withWindowSize";
|
|
|
5
5
|
|
|
6
6
|
import { fallbackValues } from "./Card.theme";
|
|
7
7
|
|
|
8
|
-
import Box from "../layouts/Box";
|
|
9
8
|
import BoxWithShadow from "../box-with-shadow";
|
|
10
9
|
import Cover from "../layouts/Cover";
|
|
11
10
|
import Stack from "../layouts/Stack";
|
|
@@ -15,23 +14,25 @@ import CardText from "./CardText";
|
|
|
15
14
|
import CardHeader from "./CardHeader";
|
|
16
15
|
|
|
17
16
|
const Card = ({
|
|
18
|
-
|
|
19
|
-
children,
|
|
17
|
+
borderRadius = "4px",
|
|
20
18
|
extraStyles,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
titleVariant = "small",
|
|
19
|
+
headerAs = "h2",
|
|
20
|
+
headerText,
|
|
21
|
+
headerVariant = "small",
|
|
25
22
|
imgSrc,
|
|
26
23
|
imgHeight = "150px",
|
|
27
24
|
imgObjectFit = "none",
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
imgAltText,
|
|
26
|
+
padding = "24px",
|
|
27
|
+
text,
|
|
28
|
+
titleText,
|
|
29
|
+
titleVariant = "small",
|
|
30
|
+
themeValues,
|
|
31
|
+
width = "276px",
|
|
32
|
+
children
|
|
32
33
|
}) => {
|
|
33
34
|
const numberOfChildren =
|
|
34
|
-
(
|
|
35
|
+
(Array.isArray(children) ? children.length : 1) +
|
|
35
36
|
(text ? 1 : 0) +
|
|
36
37
|
(imgSrc ? 1 : 0) +
|
|
37
38
|
(headerText ? 1 : 0);
|
|
@@ -56,6 +57,7 @@ const Card = ({
|
|
|
56
57
|
backgroundColor={themeValues.headerBackgroundColor}
|
|
57
58
|
borderRadius={borderRadius}
|
|
58
59
|
padding={padding}
|
|
60
|
+
as={headerAs}
|
|
59
61
|
></CardHeader>
|
|
60
62
|
)}
|
|
61
63
|
{imgSrc && (
|
|
@@ -64,6 +66,7 @@ const Card = ({
|
|
|
64
66
|
objectFit={imgObjectFit}
|
|
65
67
|
backgroundColor={themeValues.imageBackgroundColor}
|
|
66
68
|
src={imgSrc}
|
|
69
|
+
alt={imgAltText}
|
|
67
70
|
/>
|
|
68
71
|
)}
|
|
69
72
|
{text && (
|
|
@@ -4,12 +4,13 @@ import Box from "../layouts/Box";
|
|
|
4
4
|
import Title from "../title";
|
|
5
5
|
|
|
6
6
|
export const CardHeader = ({
|
|
7
|
+
backgroundColor,
|
|
8
|
+
borderRadius,
|
|
9
|
+
as,
|
|
7
10
|
headerText,
|
|
8
11
|
headerColor,
|
|
9
12
|
headerVariant,
|
|
10
|
-
|
|
11
|
-
padding,
|
|
12
|
-
borderRadius
|
|
13
|
+
padding
|
|
13
14
|
}) => {
|
|
14
15
|
return (
|
|
15
16
|
<Box
|
|
@@ -17,7 +18,7 @@ export const CardHeader = ({
|
|
|
17
18
|
background={backgroundColor}
|
|
18
19
|
borderRadius={`${borderRadius} ${borderRadius} 0 0`}
|
|
19
20
|
>
|
|
20
|
-
<Title variant={headerVariant} color={headerColor}>
|
|
21
|
+
<Title as={as} variant={headerVariant} color={headerColor}>
|
|
21
22
|
{headerText}
|
|
22
23
|
</Title>
|
|
23
24
|
</Box>
|
|
@@ -8,6 +8,7 @@ export interface CardProps {
|
|
|
8
8
|
extraStyles?: string;
|
|
9
9
|
imgSrc?: string;
|
|
10
10
|
imgHeight?: string;
|
|
11
|
+
imgAltText?: string;
|
|
11
12
|
imgObjectFit?:
|
|
12
13
|
| "contain"
|
|
13
14
|
| "cover"
|
|
@@ -19,6 +20,7 @@ export interface CardProps {
|
|
|
19
20
|
| "revert"
|
|
20
21
|
| "revert-layer"
|
|
21
22
|
| "unset";
|
|
23
|
+
headerAs?: string;
|
|
22
24
|
headerText?: string;
|
|
23
25
|
headerVariant?: string;
|
|
24
26
|
borderRadius?: string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Expand from "../../../util/expand";
|
|
3
|
+
|
|
4
|
+
export interface CollapsibleSectionProps {
|
|
5
|
+
isOpen: boolean;
|
|
6
|
+
toggleSection?: () => void;
|
|
7
|
+
isMobile?: boolean;
|
|
8
|
+
supportsTouch?: boolean;
|
|
9
|
+
title?: string;
|
|
10
|
+
customPadding?: string;
|
|
11
|
+
initiallyOpen?: boolean;
|
|
12
|
+
openHeight?: string;
|
|
13
|
+
customTitle?: boolean;
|
|
14
|
+
stackTitle?: boolean;
|
|
15
|
+
stackTitleContent?: JSX.Element;
|
|
16
|
+
sectionGap?: string;
|
|
17
|
+
name?: string;
|
|
18
|
+
index?: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const CollapsibleSection: React.FC<Expand<CollapsibleSectionProps> &
|
|
22
|
+
React.HTMLAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Expand from "../../../util/expand";
|
|
3
|
+
|
|
4
|
+
export interface EditableTableProps {
|
|
5
|
+
title?: any;
|
|
6
|
+
renderItem?: (items: any) => JSX.Element;
|
|
7
|
+
items: any;
|
|
8
|
+
isMobile?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const EditableTable: React.FC<Expand<EditableTableProps> &
|
|
12
|
+
React.HTMLAttributes<HTMLElement>>;
|
|
13
|
+
|
|
14
|
+
export interface TableListItemProps {
|
|
15
|
+
borderTopItem?: boolean;
|
|
16
|
+
canEdit?: boolean;
|
|
17
|
+
canRemove?: boolean;
|
|
18
|
+
isMobile?: boolean;
|
|
19
|
+
title?: any;
|
|
20
|
+
value?: any;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const TableListItem: React.FC<Expand<TableListItemProps> &
|
|
24
|
+
React.HTMLAttributes<HTMLElement>>;
|