@bitrise/bitkit 9.7.0 → 9.7.3

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",
4
+ "version": "9.7.3",
5
5
  "repository": "git@github.com:bitrise-io/bitkit.git",
6
6
  "main": "src/index.ts",
7
7
  "license": "UNLICENSED",
@@ -12,7 +12,7 @@
12
12
  "build:lib": "rm -rf ./lib && yarn build:lib:cjs && yarn build:lib:esn",
13
13
  "build:lib:esn": "tsc -p src -m esnext -t esnext --outDir lib/esn",
14
14
  "build:lib:cjs": "tsc -p src --outDir lib/cjs",
15
- "build:site": "rm -rf ./dist && rm -rf ./public && yarn build:docs && parcel build site/index.html -d dist",
15
+ "build:site": "rm -rf ./dist && rm -rf ./public && yarn build:docs && parcel build site/index.html -d dist --public-url '.'",
16
16
  "commitlint": "commitlint",
17
17
  "lint": "yarn lint:js",
18
18
  "lint:js": "eslint src/**/*.tsx",
@@ -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",
@@ -1,5 +1,5 @@
1
1
  import { ComponentStory, ComponentMeta } from '@storybook/react';
2
- import { sortObjectByKey } from '@/utils/storyUtils';
2
+ import { sortObjectByKey } from '../../utils/storyUtils';
3
3
  import Button from './Button';
4
4
 
5
5
  export default {
@@ -1,8 +1,8 @@
1
1
  /* eslint-disable @typescript-eslint/ban-ts-comment */
2
2
  import { forwardRef } from 'react';
3
3
  import { Button as ChakraButton, ButtonProps } from '@chakra-ui/react';
4
- import Icon from '@/Old/Icon/Icon';
5
- import { TypeIconName } from '@/Old/Icon/tsx';
4
+ import Icon from '../../Old/Icon/Icon';
5
+ import { TypeIconName } from '../../Old/Icon/tsx';
6
6
 
7
7
  export interface Props {
8
8
  as?: 'a' | 'button';
@@ -1,5 +1,5 @@
1
1
  import { ComponentStory, ComponentMeta } from '@storybook/react';
2
- import { sortObjectByKey } from '@/utils/storyUtils';
2
+ import { sortObjectByKey } from '../../utils/storyUtils';
3
3
  import Card from './Card';
4
4
 
5
5
  export default {
@@ -1,7 +1,7 @@
1
1
  import { Box, BoxProps } from '@chakra-ui/react';
2
- import { Radii } from '@/Foundations/Radii/Radii';
3
- import { Shadows } from '@/Foundations/Shadows/Shadows';
4
- import { Sizes } from '@/Foundations/Sizes/Sizes';
2
+ import { Radii } from '../../Foundations/Radii/Radii';
3
+ import { Shadows } from '../../Foundations/Shadows/Shadows';
4
+ import { Sizes } from '../../Foundations/Sizes/Sizes';
5
5
 
6
6
  export interface Props {
7
7
  borderRadius?: keyof Radii;
@@ -1,6 +1,6 @@
1
1
  import { ComponentStory, ComponentMeta } from '@storybook/react';
2
2
  import { Box } from '@chakra-ui/react';
3
- import { sortObjectByKey } from '@/utils/storyUtils';
3
+ import { sortObjectByKey } from '../../utils/storyUtils';
4
4
  import Divider from './Divider';
5
5
 
6
6
  export default {
@@ -1,6 +1,5 @@
1
1
  import { ComponentStory, ComponentMeta } from '@storybook/react';
2
- import { sortObjectByKey } from '@/utils/storyUtils';
3
- // import { IconList } from '../../../Icon/tsx';
2
+ import { sortObjectByKey } from '../../utils/storyUtils';
4
3
  import IconButton from './IconButton';
5
4
 
6
5
  export default {
@@ -1,7 +1,7 @@
1
1
  import { forwardRef } from 'react';
2
2
  import { IconButton as ChakraIconButton, IconButtonProps } from '@chakra-ui/react';
3
- import Icon from '@/Old/Icon/Icon';
4
- import { TypeIconName } from '@/Old/Icon/tsx';
3
+ import Icon from '../../Old/Icon/Icon';
4
+ import { TypeIconName } from '../../Old/Icon/tsx';
5
5
 
6
6
  export interface Props {
7
7
  iconName: TypeIconName;
@@ -1,6 +1,6 @@
1
1
  import { ComponentStory, ComponentMeta } from '@storybook/react';
2
- import { sortObjectByKey } from '@/utils/storyUtils';
3
- import Text from '@/Components/Text/Text';
2
+ import { sortObjectByKey } from '../../utils/storyUtils';
3
+ import Text from '../Text/Text';
4
4
  import Link from './Link';
5
5
 
6
6
  export default {
@@ -1,4 +1,4 @@
1
- import { textSizes } from '@/Foundations/Typography/Typography';
1
+ import { textSizes } from '../../Foundations/Typography/Typography';
2
2
 
3
3
  const LinkTheme = {
4
4
  baseStyle: {
@@ -1,5 +1,5 @@
1
1
  import { Link as ChakraLink, LinkProps } from '@chakra-ui/react';
2
- import { TextSizes } from '@/Components/Text/Text';
2
+ import { TextSizes } from '../Text/Text';
3
3
 
4
4
  export interface Props {
5
5
  children: LinkProps['children'];
@@ -1,7 +1,7 @@
1
1
  import { ComponentStory, ComponentMeta } from '@storybook/react';
2
2
  import { Box, ButtonGroup, HStack, MenuButton, MenuList, useMenuItem, useStyleConfig } from '@chakra-ui/react';
3
- import Button from '@/Components/Button/Button';
4
- import IconButton from '@/Components/IconButton/IconButton';
3
+ import Button from '../Button/Button';
4
+ import IconButton from '../IconButton/IconButton';
5
5
  import Menu from './Menu';
6
6
  import MenuItem from './MenuItem';
7
7
 
@@ -1,5 +1,5 @@
1
1
  import { ComponentStory, ComponentMeta } from '@storybook/react';
2
- import { sortObjectByKey } from '@/utils/storyUtils';
2
+ import { sortObjectByKey } from '../../utils/storyUtils';
3
3
  import Text from './Text';
4
4
 
5
5
  export default {
@@ -1,4 +1,4 @@
1
- import { textSizes } from '@/Foundations/Typography/Typography';
1
+ import { textSizes } from '../../Foundations/Typography/Typography';
2
2
 
3
3
  const TextTheme = textSizes;
4
4
 
@@ -1,9 +1,9 @@
1
1
  // import { ReactNode } from 'react';
2
2
  import { HStack, VStack } from '@chakra-ui/react';
3
- import Box from '@/Components/Box/Box';
4
- import Card from '@/Components/Card/Card';
5
- import Provider from '@/Components/Provider/Provider';
6
- import Text from '@/Components/Text/Text';
3
+ import Box from '../../Components/Box/Box';
4
+ import Card from '../../Components/Card/Card';
5
+ import Provider from '../../Components/Provider/Provider';
6
+ import Text from '../../Components/Text/Text';
7
7
 
8
8
  const TOKENS = {
9
9
  'brand.primary': 'Primary brand color',
@@ -1,10 +1,10 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { HStack, SystemStyleObject, VStack } from '@chakra-ui/react';
3
- import Box from '@/Components/Box/Box';
4
- import Card from '@/Components/Card/Card';
5
- import Divider from '@/Components/Divider/Divider';
6
- import Provider from '@/Components/Provider/Provider';
7
- import Text from '@/Components/Text/Text';
3
+ import Box from '../../Components/Box/Box';
4
+ import Card from '../../Components/Card/Card';
5
+ import Divider from '../../Components/Divider/Divider';
6
+ import Provider from '../../Components/Provider/Provider';
7
+ import Text from '../../Components/Text/Text';
8
8
  import colors, { Colors } from './Colors';
9
9
 
10
10
  const paletteKeys = ['neutral', 'purple', 'red', 'orange', 'yellow', 'green', 'turquoise', 'blue'] as Array<
@@ -1,8 +1,8 @@
1
1
  import { HStack, VStack } from '@chakra-ui/react';
2
- import Box from '@/Components/Box/Box';
3
- import Card from '@/Components/Card/Card';
4
- import Provider from '@/Components/Provider/Provider';
5
- import Text from '@/Components/Text/Text';
2
+ import Box from '../../Components/Box/Box';
3
+ import Card from '../../Components/Card/Card';
4
+ import Provider from '../../Components/Provider/Provider';
5
+ import Text from '../../Components/Text/Text';
6
6
  import radii from './Radii';
7
7
 
8
8
  export const Radii = () => (
@@ -1,8 +1,8 @@
1
1
  import { HStack, VStack } from '@chakra-ui/react';
2
- import Box from '@/Components/Box/Box';
3
- import Card from '@/Components/Card/Card';
4
- import Provider from '@/Components/Provider/Provider';
5
- import Text from '@/Components/Text/Text';
2
+ import Box from '../../Components/Box/Box';
3
+ import Card from '../../Components/Card/Card';
4
+ import Provider from '../../Components/Provider/Provider';
5
+ import Text from '../../Components/Text/Text';
6
6
  import shadows from './Shadows';
7
7
 
8
8
  export const Shadows = () => (
@@ -1,8 +1,8 @@
1
1
  import { HStack, VStack } from '@chakra-ui/react';
2
- import Box from '@/Components/Box/Box';
3
- import Card from '@/Components/Card/Card';
4
- import Provider from '@/Components/Provider/Provider';
5
- import Text from '@/Components/Text/Text';
2
+ import Box from '../../Components/Box/Box';
3
+ import Card from '../../Components/Card/Card';
4
+ import Provider from '../../Components/Provider/Provider';
5
+ import Text from '../../Components/Text/Text';
6
6
  import sizes from './Sizes';
7
7
 
8
8
  export const Sizes = () => (
@@ -1,7 +1,7 @@
1
1
  import { VStack } from '@chakra-ui/react';
2
- import Card from '@/Components/Card/Card';
3
- import Provider from '@/Components/Provider/Provider';
4
- import Text from '@/Components/Text/Text';
2
+ import Card from '../../Components/Card/Card';
3
+ import Provider from '../../Components/Provider/Provider';
4
+ import Text from '../../Components/Text/Text';
5
5
  import typography from './Typography';
6
6
 
7
7
  const style = {
@@ -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>