@bitrise/bitkit 12.29.0 → 12.29.1

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,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitrise/bitkit",
3
3
  "description": "Bitrise React component library",
4
- "version": "12.29.0",
4
+ "version": "12.29.1",
5
5
  "repository": "git@github.com:bitrise-io/bitkit.git",
6
6
  "main": "src/index.ts",
7
7
  "license": "UNLICENSED",
@@ -1,7 +1,19 @@
1
1
  const CardTheme = {
2
2
  baseStyle: {
3
3
  _focusVisible: {
4
- boxShadow: 'outline',
4
+ boxShadow: 'medium',
5
+ },
6
+ borderRadius: '8',
7
+ border: '1px solid',
8
+ },
9
+ variants: {
10
+ elevated: {
11
+ boxShadow: 'medium',
12
+ borderColor: 'neutral.93',
13
+ },
14
+ outline: {
15
+ boxShadow: 'none',
16
+ borderColor: 'neutral.90',
5
17
  },
6
18
  },
7
19
  };
@@ -7,14 +7,15 @@ export interface CardProps extends BoxProps {
7
7
  borderRadius?: keyof Radii;
8
8
  boxShadow?: keyof Shadows;
9
9
  withBorder?: boolean;
10
+ variant?: 'elevated' | 'outline';
10
11
  }
11
12
 
12
13
  /**
13
14
  * Basic container element with default box shadow and border radius. Use with `CardContent` to add padding.
14
15
  */
15
16
  const Card = forwardRef<CardProps, 'div'>((props, ref) => {
16
- const { withBorder, ...rest } = props;
17
- const css = useStyleConfig('Card');
17
+ const { withBorder, variant, ...rest } = props;
18
+ const css = useStyleConfig('Card', { variant });
18
19
 
19
20
  const properties = {
20
21
  backgroundColor: 'white',
@@ -22,9 +23,8 @@ const Card = forwardRef<CardProps, 'div'>((props, ref) => {
22
23
  width: '100%',
23
24
  ...rest,
24
25
  } as BoxProps;
25
- if (withBorder) {
26
- properties.border = '1px solid';
27
- properties.borderColor = 'neutral.93';
26
+ if (!withBorder) {
27
+ css.border = 'none';
28
28
  }
29
29
  if (props.as === 'button' && !(props as HTMLChakraProps<'button'>).type) {
30
30
  (properties as HTMLChakraProps<'button'>).type = 'button';
@@ -41,6 +41,8 @@ const Card = forwardRef<CardProps, 'div'>((props, ref) => {
41
41
  Card.defaultProps = {
42
42
  as: 'div',
43
43
  borderRadius: '8',
44
+ withBorder: true,
45
+ variant: 'elevated',
44
46
  } as CardProps;
45
47
 
46
48
  export default Card;