@bitrise/bitkit 9.7.0-alpha-chakra.3 → 9.7.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/README.md CHANGED
@@ -44,7 +44,7 @@ Cleans up the build directories
44
44
 
45
45
  #### `$ yarn lint`
46
46
 
47
- Runs Javascript and CSS linting
47
+ Runs Javascript linting
48
48
 
49
49
  #### `$ yarn serve`
50
50
 
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-alpha-chakra.3",
4
+ "version": "9.7.1",
5
5
  "repository": "git@github.com:bitrise-io/bitkit.git",
6
6
  "main": "src/index.ts",
7
7
  "license": "UNLICENSED",
@@ -40,7 +40,7 @@
40
40
  "@types/react-transition-group": "^4.4.4",
41
41
  "classnames": "^2.3.1",
42
42
  "clipboard": "^2.0.10",
43
- "framer-motion": "^6.3.1",
43
+ "framer-motion": "^6.3.2",
44
44
  "luxon": "^2.3.2",
45
45
  "react": "^17.0.2",
46
46
  "react-dom": "^17.0.2",
@@ -81,15 +81,15 @@
81
81
  "@types/luxon": "^2.3.1",
82
82
  "@types/prismjs": "^1.26.0",
83
83
  "@types/react": "17.0.44",
84
- "@types/react-dom": "^17.0.15",
84
+ "@types/react-dom": "^17.0.16",
85
85
  "@types/react-router": "^5.1.18",
86
86
  "@types/react-router-dom": "^5.3.3",
87
87
  "@types/react-transition-group": "^4.4.4",
88
88
  "@types/vfile-message": "^2.0.0",
89
- "@typescript-eslint/eslint-plugin": "^5.20.0",
90
- "@typescript-eslint/parser": "^5.20.0",
89
+ "@typescript-eslint/eslint-plugin": "^5.21.0",
90
+ "@typescript-eslint/parser": "^5.21.0",
91
91
  "@wojtekmaj/enzyme-adapter-react-17": "^0.6.7",
92
- "axios": "^0.26.1",
92
+ "axios": "^0.27.1",
93
93
  "babel-eslint": "^10.0.1",
94
94
  "babel-loader": "^8.2.5",
95
95
  "babel-plugin-polyfill-corejs2": "^0.3.1",
@@ -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.13.0",
100
+ "eslint": "^8.14.0",
101
101
  "eslint-plugin-import": "^2.26.0",
102
- "eslint-plugin-jest": "^26.1.4",
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 Template: ComponentStory<typeof Link> = ({ ...props }) => <Link {...props} />;
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
- const TextTheme = {
2
- sizes: {
3
- 1: {
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?: '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8';
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;
@@ -33,10 +33,10 @@ export interface Props extends FlexProps {
33
33
 
34
34
  /** Standard Button component */
35
35
  const Button: React.FunctionComponent<Props> = (props: Props) => {
36
- const { borderless, fullWidth, level, size, variant, ...rest } = props;
36
+ const { borderless, className, fullWidth, level, size, variant, ...rest } = props;
37
37
 
38
38
  const gap = size === 'small' ? 'x1' : 'x2';
39
- const classes = classnames('Button', `Button--level-${level}`, `Button--size-${size}`, {
39
+ const classes = classnames(className, 'Button', `Button--level-${level}`, `Button--size-${size}`, {
40
40
  'Button--borderless': borderless,
41
41
  'Button--full-width': fullWidth,
42
42
  [`Button--variant-${variant}`]: variant,
@@ -30,6 +30,7 @@ export interface Props extends DropdownButtonProps {
30
30
  /** Selected value from the options */
31
31
  selected?: DropdownValue;
32
32
  maxHeight?: string;
33
+ menuClassName?: string;
33
34
  }
34
35
 
35
36
  /**
@@ -38,7 +39,7 @@ export interface Props extends DropdownButtonProps {
38
39
  * and custom should be done with Placement.
39
40
  */
40
41
  const Dropdown: React.FunctionComponent<Props> = (props: Props) => {
41
- const { children, options, onChange, selected, maxHeight, ...rest } = props;
42
+ const { children, options, onChange, selected, maxHeight, menuClassName, ...rest } = props;
42
43
  const [visible, setVisible] = useState(false);
43
44
 
44
45
  const handleChange = (value: DropdownValue) => {
@@ -73,7 +74,7 @@ const Dropdown: React.FunctionComponent<Props> = (props: Props) => {
73
74
 
74
75
  <Placement onClose={() => setVisible(false)} sameWidth visible={visible}>
75
76
  {() => (
76
- <DropdownMenu maxHeight={maxHeight} width="100%">
77
+ <DropdownMenu className={menuClassName} maxHeight={maxHeight} width="100%">
77
78
  {options.map((option) => (
78
79
  <React.Fragment key={option.text}>
79
80
  {'options' in option ? (
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import classNames from 'classnames';
2
3
  import { Props as BaseProps } from '../Base/Base';
3
4
  import Flex from '../Flex/Flex';
4
5
  import PlacementArea from '../Placement/PlacementArea';
@@ -15,11 +16,13 @@ export interface Props extends BaseProps {
15
16
  * Parent container for DropdownMenuItems
16
17
  */
17
18
  const DropdownMenu: React.FunctionComponent<Props> = (props: Props) => {
18
- const { children, maxHeight, width, ...rest } = props;
19
+ const { className, children, maxHeight, width, ...rest } = props;
20
+
21
+ const classes = classNames(className, 'DropdownMenu__content');
19
22
 
20
23
  return (
21
24
  <PlacementArea {...rest} direction="vertical" paddingVertical="x4">
22
- <Flex className="DropdownMenu__content" direction="vertical" maxHeight={maxHeight} width={width}>
25
+ <Flex className={classes} direction="vertical" maxHeight={maxHeight} width={width}>
23
26
  {children}
24
27
  </Flex>
25
28
  </PlacementArea>
@@ -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';