@bitrise/bitkit 9.7.0-alpha-chakra.2 → 9.7.0
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 +3 -3
- package/src/Components/Link/Link.stories.tsx +14 -4
- package/src/Components/Link/Link.theme.ts +4 -0
- package/src/Components/Link/Link.tsx +2 -0
- package/src/Components/Text/Text.theme.ts +3 -36
- package/src/Components/Text/Text.tsx +3 -1
- package/src/Foundations/Typography/Typography.ts +37 -0
- package/src/Old/Input/Input.css +1 -1
- package/src/Old/Input/InputLabel.tsx +1 -1
- package/src/Old/Modal/Modal.tsx +1 -1
- package/src/Old/Table/TableHeaderCell.tsx +1 -1
- package/src/index.ts +2 -0
- package/src/tsconfig.tsbuildinfo +1 -1
- package/src/utils/utils.ts +3 -2
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.7.0
|
|
4
|
+
"version": "9.7.0",
|
|
5
5
|
"repository": "git@github.com:bitrise-io/bitkit.git",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"license": "UNLICENSED",
|
|
@@ -97,9 +97,9 @@
|
|
|
97
97
|
"concurrently": "^7.1.0",
|
|
98
98
|
"enzyme": "^3.11.0",
|
|
99
99
|
"enzyme-to-json": "^3.6.2",
|
|
100
|
-
"eslint": "^8.
|
|
100
|
+
"eslint": "^8.14.0",
|
|
101
101
|
"eslint-plugin-import": "^2.26.0",
|
|
102
|
-
"eslint-plugin-jest": "^26.1.
|
|
102
|
+
"eslint-plugin-jest": "^26.1.5",
|
|
103
103
|
"eslint-plugin-jsx-a11y": "^6.5.1",
|
|
104
104
|
"eslint-plugin-prettier": "^4.0.0",
|
|
105
105
|
"eslint-plugin-react": "^7.29.4",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
2
2
|
import { sortObjectByKey } from '@/utils/storyUtils';
|
|
3
|
+
import Text from '@/Components/Text/Text';
|
|
3
4
|
import Link from './Link';
|
|
4
5
|
|
|
5
6
|
export default {
|
|
@@ -7,12 +8,21 @@ export default {
|
|
|
7
8
|
component: Link,
|
|
8
9
|
} as ComponentMeta<typeof Link>;
|
|
9
10
|
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
export const WithProps = Template.bind({});
|
|
13
|
-
WithProps.args = sortObjectByKey({
|
|
11
|
+
const args = sortObjectByKey({
|
|
14
12
|
...Link.defaultProps,
|
|
15
13
|
children: 'The quick brown fox jumps over the lazy dog.',
|
|
16
14
|
href: '#',
|
|
17
15
|
target: '_self',
|
|
18
16
|
});
|
|
17
|
+
|
|
18
|
+
export const WithProps: ComponentStory<typeof Link> = ({ ...props }) => <Link {...props} />;
|
|
19
|
+
WithProps.args = args;
|
|
20
|
+
|
|
21
|
+
export const InsideText: ComponentStory<typeof Link> = ({ ...props }) => (
|
|
22
|
+
<Text size="2">
|
|
23
|
+
This is a text with link: <Link {...props} />
|
|
24
|
+
<br />
|
|
25
|
+
The Link inherits fontSize, but you can overwrite with size param (or sx).
|
|
26
|
+
</Text>
|
|
27
|
+
);
|
|
28
|
+
InsideText.args = args;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
+
import { textSizes } from '@/Foundations/Typography/Typography';
|
|
2
|
+
|
|
1
3
|
const LinkTheme = {
|
|
2
4
|
baseStyle: {
|
|
3
5
|
color: 'text.link',
|
|
6
|
+
fontSize: 'inherit',
|
|
4
7
|
_hover: {
|
|
5
8
|
color: 'text.linkHover',
|
|
6
9
|
},
|
|
7
10
|
},
|
|
11
|
+
...textSizes,
|
|
8
12
|
};
|
|
9
13
|
|
|
10
14
|
export default LinkTheme;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { Link as ChakraLink, LinkProps } from '@chakra-ui/react';
|
|
2
|
+
import { TextSizes } from '@/Components/Text/Text';
|
|
2
3
|
|
|
3
4
|
export interface Props {
|
|
4
5
|
children: LinkProps['children'];
|
|
5
6
|
href: string;
|
|
6
7
|
isUnderlined?: boolean;
|
|
8
|
+
size?: TextSizes;
|
|
7
9
|
sx?: LinkProps['sx'];
|
|
8
10
|
target?: '_blank' | '_parent' | '_self' | '_top';
|
|
9
11
|
}
|
|
@@ -1,38 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
fontSize: '1',
|
|
5
|
-
lineHeight: '1',
|
|
6
|
-
},
|
|
7
|
-
2: {
|
|
8
|
-
fontSize: '2',
|
|
9
|
-
lineHeight: '2',
|
|
10
|
-
},
|
|
11
|
-
3: {
|
|
12
|
-
fontSize: '3',
|
|
13
|
-
lineHeight: '3',
|
|
14
|
-
},
|
|
15
|
-
4: {
|
|
16
|
-
fontSize: '4',
|
|
17
|
-
lineHeight: '4',
|
|
18
|
-
},
|
|
19
|
-
5: {
|
|
20
|
-
fontSize: '5',
|
|
21
|
-
lineHeight: '5',
|
|
22
|
-
},
|
|
23
|
-
6: {
|
|
24
|
-
fontSize: '6',
|
|
25
|
-
lineHeight: '6',
|
|
26
|
-
},
|
|
27
|
-
7: {
|
|
28
|
-
fontSize: '7',
|
|
29
|
-
lineHeight: '7',
|
|
30
|
-
},
|
|
31
|
-
8: {
|
|
32
|
-
fontSize: '8',
|
|
33
|
-
lineHeight: '8',
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
};
|
|
1
|
+
import { textSizes } from '@/Foundations/Typography/Typography';
|
|
2
|
+
|
|
3
|
+
const TextTheme = textSizes;
|
|
37
4
|
|
|
38
5
|
export default TextTheme;
|
|
@@ -34,6 +34,8 @@ type TextTags =
|
|
|
34
34
|
| 'time'
|
|
35
35
|
| 'var';
|
|
36
36
|
|
|
37
|
+
export type TextSizes = '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8';
|
|
38
|
+
|
|
37
39
|
export interface Props {
|
|
38
40
|
align?: 'center' | 'justify' | 'left' | 'right';
|
|
39
41
|
/**
|
|
@@ -51,7 +53,7 @@ export interface Props {
|
|
|
51
53
|
/**
|
|
52
54
|
* Size config (https://www.figma.com/file/grik9mTaJ5DfhydhWhXdP5/Bitkit-Foundations?node-id=211%3A12)
|
|
53
55
|
*/
|
|
54
|
-
size?:
|
|
56
|
+
size?: TextSizes;
|
|
55
57
|
sx?: TextProps['sx'];
|
|
56
58
|
textTransform?: 'capitalize' | 'lowercase' | 'none' | 'uppercase';
|
|
57
59
|
}
|
|
@@ -29,4 +29,41 @@ const typography = {
|
|
|
29
29
|
},
|
|
30
30
|
};
|
|
31
31
|
|
|
32
|
+
export const textSizes = {
|
|
33
|
+
sizes: {
|
|
34
|
+
1: {
|
|
35
|
+
fontSize: '1',
|
|
36
|
+
lineHeight: '1',
|
|
37
|
+
},
|
|
38
|
+
2: {
|
|
39
|
+
fontSize: '2',
|
|
40
|
+
lineHeight: '2',
|
|
41
|
+
},
|
|
42
|
+
3: {
|
|
43
|
+
fontSize: '3',
|
|
44
|
+
lineHeight: '3',
|
|
45
|
+
},
|
|
46
|
+
4: {
|
|
47
|
+
fontSize: '4',
|
|
48
|
+
lineHeight: '4',
|
|
49
|
+
},
|
|
50
|
+
5: {
|
|
51
|
+
fontSize: '5',
|
|
52
|
+
lineHeight: '5',
|
|
53
|
+
},
|
|
54
|
+
6: {
|
|
55
|
+
fontSize: '6',
|
|
56
|
+
lineHeight: '6',
|
|
57
|
+
},
|
|
58
|
+
7: {
|
|
59
|
+
fontSize: '7',
|
|
60
|
+
lineHeight: '7',
|
|
61
|
+
},
|
|
62
|
+
8: {
|
|
63
|
+
fontSize: '8',
|
|
64
|
+
lineHeight: '8',
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
|
|
32
69
|
export default typography;
|
package/src/Old/Input/Input.css
CHANGED
|
@@ -8,7 +8,7 @@ export type Props = TextProps;
|
|
|
8
8
|
* input.
|
|
9
9
|
*/
|
|
10
10
|
const InputLabel: React.FunctionComponent<Props> = (props: Props) => {
|
|
11
|
-
return <Text {...props} Component="label" margin="x1" size="3" textColor="grape-
|
|
11
|
+
return <Text {...props} Component="label" margin="x1" size="3" textColor="grape-5" weight="bold" />;
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export default InputLabel;
|
package/src/Old/Modal/Modal.tsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import classnames from 'classnames';
|
|
3
|
+
import Flex from '../Flex/Flex';
|
|
3
4
|
import Icon from '../Icon/Icon';
|
|
4
5
|
import Text, { Props as TextProps } from '../Text/Text';
|
|
5
6
|
import Visibility from '../Visibility/Visibility';
|
|
6
7
|
import VisibilityContainer from '../Visibility/VisibilityContainer';
|
|
7
|
-
import Flex from '../Flex/Flex';
|
|
8
8
|
|
|
9
9
|
export type TypeTableSort = 'asc' | 'desc';
|
|
10
10
|
|
package/src/index.ts
CHANGED
|
@@ -8,6 +8,8 @@ export { hooks };
|
|
|
8
8
|
export { default as Provider } from './Components/Provider/Provider';
|
|
9
9
|
export { default as theme } from './theme';
|
|
10
10
|
|
|
11
|
+
export type { TypeBorderRadius } from './Old/Base/Base';
|
|
12
|
+
|
|
11
13
|
export { default as AddonBeam, Props as AddonBeamProps } from './Old/AddonBeam/AddonBeam';
|
|
12
14
|
export { default as AddonBeamLink, Props as AddonBeamLinkProps } from './Old/AddonBeam/AddonBeamLink';
|
|
13
15
|
export { default as AddonFooter, Props as AddonFooterProps } from './Old/AddonFooter/AddonFooter';
|