@thecb/components 7.13.4-beta.8 → 7.13.4-beta.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "7.13.4-beta.8",
3
+ "version": "7.13.4-beta.9",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -1,4 +1,4 @@
1
- import React, { Fragment } from "react";
1
+ import React from "react";
2
2
 
3
3
  import { themeComponent } from "../../../util/themeUtils";
4
4
  import withWindowSize from "../../withWindowSize";
@@ -32,8 +32,6 @@ const Card = ({
32
32
  titleVariant = "small",
33
33
  themeValues,
34
34
  width = "276px",
35
- direction = "column",
36
- boxStyles = "",
37
35
  children
38
36
  }) => {
39
37
  const hasImage = Image || imgSrc;
@@ -58,7 +56,7 @@ const Card = ({
58
56
  fullHeight
59
57
  childGap="0"
60
58
  bottomItem={numberOfChildren}
61
- direction={direction}
59
+ direction="row"
62
60
  >
63
61
  {headerText && (
64
62
  <CardHeader
@@ -93,7 +91,7 @@ const Card = ({
93
91
  alt={imgAltText}
94
92
  />
95
93
  )}
96
- <Box extraStyles={boxStyles}>
94
+ <Box padding="0">
97
95
  {text && (
98
96
  <CardText
99
97
  padding={padding}
@@ -27,8 +27,6 @@ export interface CardProps {
27
27
  borderRadius?: string;
28
28
  width?: string;
29
29
  padding?: string;
30
- boxStyles?: string;
31
- direction?: "column" | "row";
32
30
  }
33
31
 
34
32
  export const Card: React.FC<Expand<CardProps> &
@@ -1,113 +0,0 @@
1
- import React, { Fragment } from "react";
2
-
3
- import { themeComponent } from "../../../util/themeUtils";
4
- import withWindowSize from "../../withWindowSize";
5
-
6
- import { fallbackValues } from "../card/Card.theme";
7
-
8
- import Box from "../layouts/Box";
9
- import BoxWithShadow from "../box-with-shadow";
10
- import Center from "../layouts/Center";
11
- import Cover from "../layouts/Cover";
12
- import Stack from "../layouts/Stack";
13
-
14
- import CardImage from "../card/CardImage.styled";
15
- import CardText from "../card/CardText";
16
- import CardHeader from "../card/CardHeader";
17
-
18
- const CardAlt = ({
19
- borderRadius = "4px",
20
- extraStyles,
21
- headerAs = "h2",
22
- headerText,
23
- headerVariant = "small",
24
- imgSrc,
25
- Image,
26
- imgHeight = "150px",
27
- imgObjectFit = "none",
28
- imgAltText,
29
- padding = "24px",
30
- text,
31
- titleText,
32
- titleVariant = "small",
33
- themeValues,
34
- width = "276px",
35
- children
36
- }) => {
37
- const hasImage = Image || imgSrc;
38
- const numberOfChildren =
39
- (Array.isArray(children) ? children.length : 1) +
40
- (text ? 1 : 0) +
41
- (hasImage ? 1 : 0) +
42
- (headerText ? 1 : 0);
43
-
44
- return (
45
- <BoxWithShadow
46
- variant="baseStandard"
47
- background={themeValues.backgroundColor}
48
- borderRadius={borderRadius}
49
- padding="0"
50
- margin="0"
51
- minWidth={width}
52
- extraStyles={extraStyles}
53
- >
54
- <Cover singleChild fillCenter>
55
- <Stack
56
- fullHeight
57
- childGap="0"
58
- bottomItem={numberOfChildren}
59
- direction="row"
60
- >
61
- {headerText && (
62
- <CardHeader
63
- headerText={headerText}
64
- headerColor={themeValues.headerColor}
65
- headerVariant={headerVariant}
66
- backgroundColor={themeValues.headerBackgroundColor}
67
- borderRadius={borderRadius}
68
- padding={padding}
69
- as={headerAs}
70
- ></CardHeader>
71
- )}
72
- {Image && !imgSrc && (
73
- <Box
74
- minHeight={imgHeight}
75
- padding="0"
76
- background={themeValues.imageBackgroundColor}
77
- >
78
- <Cover minHeight={imgHeight} singleChild>
79
- <Center intrinsic>
80
- <Image alt={imgAltText} />
81
- </Center>
82
- </Cover>
83
- </Box>
84
- )}
85
- {imgSrc && (
86
- <CardImage
87
- height={imgHeight}
88
- objectFit={imgObjectFit}
89
- backgroundColor={themeValues.imageBackgroundColor}
90
- src={imgSrc}
91
- alt={imgAltText}
92
- />
93
- )}
94
- {text && (
95
- <CardText
96
- padding={padding}
97
- titleText={titleText}
98
- text={text}
99
- titleVariant={titleVariant}
100
- />
101
- )}
102
- {children}
103
- </Stack>
104
- </Cover>
105
- </BoxWithShadow>
106
- );
107
- };
108
-
109
- export default themeComponent(
110
- withWindowSize(CardAlt),
111
- "CardAlt",
112
- fallbackValues
113
- );
@@ -1,3 +0,0 @@
1
- import CardAlt from "./CardAlt";
2
-
3
- export default CardAlt;