@bitrise/bitkit 9.12.1-alpha-chakra.3 → 9.12.1-alpha-chakra.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/package.json +1 -1
- package/src/Components/Card/Card.stories.tsx +19 -10
- package/src/Components/Card/Card.tsx +7 -2
- package/src/Components/Card/CardContent.tsx +1 -3
- package/src/Foundations/Colors/DesignTokens.tsx +1 -1
- package/src/Foundations/Colors/Palette.tsx +1 -1
- package/src/Foundations/Radii/Radii.examples.tsx +11 -22
- package/src/Foundations/Shadows/Shadows.examples.tsx +10 -20
- package/src/Foundations/Sizes/Sizes.examples.tsx +11 -21
- package/src/Foundations/Typography/Typography.examples.tsx +1 -1
- package/src/tsconfig.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitrise/bitkit",
|
|
3
3
|
"description": "Bitrise React component library",
|
|
4
|
-
"version": "9.12.1-alpha-chakra.
|
|
4
|
+
"version": "9.12.1-alpha-chakra.4",
|
|
5
5
|
"repository": "git@github.com:bitrise-io/bitkit.git",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"license": "UNLICENSED",
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
2
|
-
import { sortObjectByKey } from '../../utils/storyUtils';
|
|
3
2
|
import Divider from '../Divider/Divider';
|
|
4
3
|
import Card from './Card';
|
|
5
4
|
import CardContent from './CardContent';
|
|
@@ -10,26 +9,36 @@ export default {
|
|
|
10
9
|
subcomponents: { CardContent },
|
|
11
10
|
} as ComponentMeta<typeof Card>;
|
|
12
11
|
|
|
13
|
-
export const WithProps: ComponentStory<typeof Card> = (props) => (
|
|
12
|
+
export const WithProps: ComponentStory<typeof Card> = ({ contentProps, ...props }) => (
|
|
14
13
|
<Card {...props}>
|
|
15
|
-
<CardContent>The quick brown fox jumps over the lazy dog.</CardContent>
|
|
14
|
+
<CardContent {...contentProps}>The quick brown fox jumps over the lazy dog.</CardContent>
|
|
16
15
|
</Card>
|
|
17
16
|
);
|
|
18
17
|
|
|
19
|
-
WithProps.args =
|
|
18
|
+
WithProps.args = {
|
|
20
19
|
...Card.defaultProps,
|
|
20
|
+
boxShadow: 'medium',
|
|
21
21
|
className: '',
|
|
22
|
-
|
|
22
|
+
withBorder: false,
|
|
23
|
+
contentProps: {
|
|
24
|
+
padding: '24',
|
|
25
|
+
},
|
|
26
|
+
};
|
|
23
27
|
|
|
24
|
-
export const DividedContent: ComponentStory<typeof Card> = (props) => (
|
|
28
|
+
export const DividedContent: ComponentStory<typeof Card> = ({ contentProps, ...props }) => (
|
|
25
29
|
<Card {...props}>
|
|
26
|
-
<CardContent>The quick brown fox jumps over the lazy dog.</CardContent>
|
|
30
|
+
<CardContent {...contentProps}>The quick brown fox jumps over the lazy dog.</CardContent>
|
|
27
31
|
<Divider />
|
|
28
|
-
<CardContent>The quick brown fox jumps over the lazy dog.</CardContent>
|
|
32
|
+
<CardContent {...contentProps}>The quick brown fox jumps over the lazy dog.</CardContent>
|
|
29
33
|
</Card>
|
|
30
34
|
);
|
|
31
35
|
|
|
32
|
-
DividedContent.args =
|
|
36
|
+
DividedContent.args = {
|
|
33
37
|
...Card.defaultProps,
|
|
38
|
+
boxShadow: 'medium',
|
|
34
39
|
className: '',
|
|
35
|
-
|
|
40
|
+
withBorder: false,
|
|
41
|
+
contentProps: {
|
|
42
|
+
padding: '24',
|
|
43
|
+
},
|
|
44
|
+
};
|
|
@@ -7,18 +7,24 @@ import Box, { BoxProps } from '../Box/Box';
|
|
|
7
7
|
export interface CardProps extends BoxProps {
|
|
8
8
|
borderRadius?: keyof Radii;
|
|
9
9
|
boxShadow?: keyof Shadows;
|
|
10
|
+
withBorder?: boolean;
|
|
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) => {
|
|
17
|
+
const { withBorder, ...rest } = props;
|
|
16
18
|
const properties = {
|
|
17
19
|
backgroundColor: 'white',
|
|
18
20
|
display: 'block',
|
|
19
21
|
width: '100%',
|
|
20
|
-
...
|
|
22
|
+
...rest,
|
|
21
23
|
} as BoxProps;
|
|
24
|
+
if (withBorder) {
|
|
25
|
+
properties.border = '1px solid';
|
|
26
|
+
properties.borderColor = 'neutral.93';
|
|
27
|
+
}
|
|
22
28
|
if (props.as === 'button' && !(props as HTMLChakraProps<'button'>).type) {
|
|
23
29
|
(properties as HTMLChakraProps<'button'>).type = 'button';
|
|
24
30
|
}
|
|
@@ -28,7 +34,6 @@ const Card = forwardRef<CardProps, 'div'>((props, ref) => {
|
|
|
28
34
|
Card.defaultProps = {
|
|
29
35
|
as: 'div',
|
|
30
36
|
borderRadius: '8',
|
|
31
|
-
boxShadow: 'small',
|
|
32
37
|
} as CardProps;
|
|
33
38
|
|
|
34
39
|
export default Card;
|
|
@@ -34,7 +34,7 @@ const DesignTokens = () => {
|
|
|
34
34
|
plugin called “Theemo”.
|
|
35
35
|
</Text>
|
|
36
36
|
</Box>
|
|
37
|
-
<Card marginBottom="96">
|
|
37
|
+
<Card boxShadow="medium" marginBottom="96" padding="24">
|
|
38
38
|
<VStack align="flex-start" as="ul" spacing="32">
|
|
39
39
|
{Object.keys(TOKENS).map((token: string) => (
|
|
40
40
|
<HStack as="li" key={token} spacing="32">
|
|
@@ -76,7 +76,7 @@ const Palette = () => (
|
|
|
76
76
|
<Text as="h2" size="8">
|
|
77
77
|
Full palette
|
|
78
78
|
</Text>
|
|
79
|
-
<Card marginTop="24">
|
|
79
|
+
<Card boxShadow="medium" marginTop="24" padding="24">
|
|
80
80
|
<HStack spacing="0" sx={{ alignItems: 'flex-start', marginBottom: '16' }}>
|
|
81
81
|
<VStack spacing="0">
|
|
82
82
|
<InfoHeader
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { HStack, VStack } from '@chakra-ui/react';
|
|
2
2
|
import Box from '../../Components/Box/Box';
|
|
3
3
|
import Card from '../../Components/Card/Card';
|
|
4
|
+
import CardContent from '../../Components/Card/CardContent';
|
|
4
5
|
import Provider from '../../Components/Provider/Provider';
|
|
5
6
|
import Text from '../../Components/Text/Text';
|
|
6
7
|
import radii from './Radii';
|
|
@@ -10,27 +11,15 @@ export const Radii = () => (
|
|
|
10
11
|
<Text as="h2" size="8">
|
|
11
12
|
Radii (round corners)
|
|
12
13
|
</Text>
|
|
13
|
-
<
|
|
14
|
-
as={
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
sx={{
|
|
24
|
-
border: '0.1875rem solid',
|
|
25
|
-
borderColor: 'brand.primary',
|
|
26
|
-
borderRadius: size,
|
|
27
|
-
height: '64',
|
|
28
|
-
width: '64',
|
|
29
|
-
}}
|
|
30
|
-
/>
|
|
31
|
-
<Text>{size}</Text>
|
|
32
|
-
</VStack>
|
|
33
|
-
))}
|
|
34
|
-
</HStack>
|
|
14
|
+
<Card boxShadow="medium" marginTop="24">
|
|
15
|
+
<HStack as={CardContent} padding="24" spacing="24">
|
|
16
|
+
{Object.keys(radii).map((size) => (
|
|
17
|
+
<VStack key={size}>
|
|
18
|
+
<Box border="0.1875rem solid" borderColor="brand.primary" borderRadius={size} height="64" width="64" />
|
|
19
|
+
<Text>{size}</Text>
|
|
20
|
+
</VStack>
|
|
21
|
+
))}
|
|
22
|
+
</HStack>
|
|
23
|
+
</Card>
|
|
35
24
|
</Provider>
|
|
36
25
|
);
|
|
@@ -10,25 +10,15 @@ export const Shadows = () => (
|
|
|
10
10
|
<Text as="h2" size="8">
|
|
11
11
|
Shadows
|
|
12
12
|
</Text>
|
|
13
|
-
<
|
|
14
|
-
as={Card}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
sx={{
|
|
24
|
-
width: 32,
|
|
25
|
-
height: 32,
|
|
26
|
-
boxShadow: key,
|
|
27
|
-
}}
|
|
28
|
-
/>
|
|
29
|
-
<Text>{key}</Text>
|
|
30
|
-
</VStack>
|
|
31
|
-
))}
|
|
32
|
-
</HStack>
|
|
13
|
+
<Card boxShadow="medium" marginTop="24">
|
|
14
|
+
<HStack as={Card} padding="24" spacing="32">
|
|
15
|
+
{Object.keys(shadows).map((key) => (
|
|
16
|
+
<VStack key={key}>
|
|
17
|
+
<Box boxShadow={key} height="32" width="32" />
|
|
18
|
+
<Text as="span">{key}</Text>
|
|
19
|
+
</VStack>
|
|
20
|
+
))}
|
|
21
|
+
</HStack>
|
|
22
|
+
</Card>
|
|
33
23
|
</Provider>
|
|
34
24
|
);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { HStack, VStack } from '@chakra-ui/react';
|
|
2
2
|
import Box from '../../Components/Box/Box';
|
|
3
3
|
import Card from '../../Components/Card/Card';
|
|
4
|
+
import CardContent from '../../Components/Card/CardContent';
|
|
4
5
|
import Provider from '../../Components/Provider/Provider';
|
|
5
6
|
import Text from '../../Components/Text/Text';
|
|
6
7
|
import sizes from './Sizes';
|
|
@@ -10,26 +11,15 @@ export const Sizes = () => (
|
|
|
10
11
|
<Text as="h2" size="8">
|
|
11
12
|
Sizes
|
|
12
13
|
</Text>
|
|
13
|
-
<
|
|
14
|
-
as={
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<Box
|
|
24
|
-
sx={{
|
|
25
|
-
width: size,
|
|
26
|
-
height: size,
|
|
27
|
-
background: 'brand.primary',
|
|
28
|
-
}}
|
|
29
|
-
/>
|
|
30
|
-
<Text>{size}</Text>
|
|
31
|
-
</VStack>
|
|
32
|
-
))}
|
|
33
|
-
</HStack>
|
|
14
|
+
<Card boxShadow="medium" marginTop="24">
|
|
15
|
+
<HStack as={CardContent} alignItems="flex-end" padding="24" spacing="24">
|
|
16
|
+
{Object.keys(sizes).map((size) => (
|
|
17
|
+
<VStack key={size}>
|
|
18
|
+
<Box backgroundColor="brand.primary" height={size} width={size} />
|
|
19
|
+
<Text>{size}</Text>
|
|
20
|
+
</VStack>
|
|
21
|
+
))}
|
|
22
|
+
</HStack>
|
|
23
|
+
</Card>
|
|
34
24
|
</Provider>
|
|
35
25
|
);
|
|
@@ -31,7 +31,7 @@ export const FontSizes = () => (
|
|
|
31
31
|
<Text sx={{ marginTop: '8' }}>
|
|
32
32
|
<strong>Text transform:</strong> None, UPPERCASE
|
|
33
33
|
</Text>
|
|
34
|
-
<Card marginTop="24">
|
|
34
|
+
<Card boxShadow="medium" marginTop="24" padding="24">
|
|
35
35
|
<VStack as="ol" spacing={24} sx={style}>
|
|
36
36
|
<Text as="li" size="1">
|
|
37
37
|
{typography.fontSizes[1]} / {typography.lineHeights[1]} / Normal / Uppercase
|