@bitrise/bitkit 12.29.0 → 12.29.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/package.json
CHANGED
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
const CardTheme = {
|
|
2
2
|
baseStyle: {
|
|
3
3
|
_focusVisible: {
|
|
4
|
-
boxShadow: '
|
|
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
|
-
* Basic container element with default box shadow and border radius.
|
|
14
|
+
* Basic container element with default box shadow and border radius.
|
|
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
|
-
|
|
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;
|
|
@@ -1,8 +1,23 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { ChakraProvider } from '@chakra-ui/react';
|
|
2
3
|
import theme from '../../theme';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
type ProviderProps = {
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
toastOffset?: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
const Provider = ({ children, toastOffset }: ProviderProps) => {
|
|
11
|
+
return (
|
|
12
|
+
<ChakraProvider
|
|
13
|
+
theme={theme}
|
|
14
|
+
toastOptions={{
|
|
15
|
+
defaultOptions: toastOffset ? { containerStyle: { transform: `translateY(${toastOffset})` } } : undefined,
|
|
16
|
+
}}
|
|
17
|
+
>
|
|
18
|
+
{children}
|
|
19
|
+
</ChakraProvider>
|
|
20
|
+
);
|
|
6
21
|
};
|
|
7
22
|
|
|
8
23
|
export default Provider;
|
|
@@ -5,7 +5,7 @@ import Notification, { ActionProps, NotificationAction, NotificationProps } from
|
|
|
5
5
|
|
|
6
6
|
export interface ToastOptions {
|
|
7
7
|
title: string;
|
|
8
|
-
description
|
|
8
|
+
description?: React.ReactNode;
|
|
9
9
|
status: NotificationProps['status'];
|
|
10
10
|
action?: ActionProps;
|
|
11
11
|
duration?: UseToastOptions['duration'];
|
|
@@ -24,7 +24,7 @@ const useToast = () => {
|
|
|
24
24
|
toast({
|
|
25
25
|
isClosable: opts.isClosable,
|
|
26
26
|
duration: opts.duration,
|
|
27
|
-
position: opts.position || '
|
|
27
|
+
position: opts.position || 'top-right',
|
|
28
28
|
render: ({ onClose }) => (
|
|
29
29
|
<Notification
|
|
30
30
|
boxShadow="large"
|
|
@@ -34,7 +34,7 @@ const useToast = () => {
|
|
|
34
34
|
>
|
|
35
35
|
<Box display="flex" flexDirection="column">
|
|
36
36
|
<AlertTitle>{opts.title}</AlertTitle>
|
|
37
|
-
<AlertDescription>{opts.description}</AlertDescription>
|
|
37
|
+
{opts.description && <AlertDescription>{opts.description}</AlertDescription>}
|
|
38
38
|
{!opts.action && timestamp && <AlertDescription marginTop="8">{timestamp}</AlertDescription>}
|
|
39
39
|
{opts.action && <NotificationAction alignSelf="start" marginTop="8" marginBottom="4" {...opts.action} />}
|
|
40
40
|
</Box>
|
package/src/index.ts
CHANGED
|
@@ -29,9 +29,6 @@ export { default as ButtonGroup } from './Components/ButtonGroup/ButtonGroup';
|
|
|
29
29
|
export type { CardProps } from './Components/Card/Card';
|
|
30
30
|
export { default as Card } from './Components/Card/Card';
|
|
31
31
|
|
|
32
|
-
export type { CardContentProps } from './Components/Card/CardContent';
|
|
33
|
-
export { default as CardContent } from './Components/Card/CardContent';
|
|
34
|
-
|
|
35
32
|
export type { TextProps } from './Components/Text/Text';
|
|
36
33
|
export { default as Text } from './Components/Text/Text';
|
|
37
34
|
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import Box, { BoxProps } from '../Box/Box';
|
|
2
|
-
|
|
3
|
-
export type CardContentProps = BoxProps;
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Basic container element with default box shadow, border radius and padding.
|
|
7
|
-
*/
|
|
8
|
-
const CardContent = (props: CardContentProps) => {
|
|
9
|
-
return <Box {...props} />;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
CardContent.defaultProps = {} as CardContentProps;
|
|
13
|
-
|
|
14
|
-
export default CardContent;
|