@bitrise/bitkit 13.62.1-alpha.1 → 13.63.1-alpha.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitrise/bitkit",
3
3
  "description": "Bitrise React component library",
4
- "version": "13.62.1-alpha.1",
4
+ "version": "13.63.1-alpha.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+ssh://git@github.com/bitrise-io/bitkit.git"
@@ -38,10 +38,10 @@
38
38
  "@floating-ui/react-dom-interactions": "^0.8.1",
39
39
  "@fontsource/figtree": "^5.0.20",
40
40
  "@fontsource/source-code-pro": "^5.0.18",
41
- "framer-motion": "^11.1.7",
41
+ "framer-motion": "^11.1.8",
42
42
  "luxon": "^3.4.4",
43
- "react": "^18.2.0",
44
- "react-dom": "^18.2.0",
43
+ "react": "^18.3.1",
44
+ "react-dom": "^18.3.1",
45
45
  "react-focus-lock": "^2.12.1",
46
46
  "react-imask": "^7.6.0",
47
47
  "react-markdown": "^9.0.1"
@@ -51,32 +51,32 @@
51
51
  "react-dom": "^18.2.0"
52
52
  },
53
53
  "devDependencies": {
54
- "@babel/core": "^7.24.4",
55
- "@babel/preset-env": "^7.24.4",
54
+ "@babel/core": "^7.24.5",
55
+ "@babel/preset-env": "^7.24.5",
56
56
  "@babel/preset-react": "^7.24.1",
57
57
  "@babel/preset-typescript": "^7.24.1",
58
58
  "@bitrise/eslint-plugin": "^2.10.2",
59
59
  "@chakra-ui/cli": "^2.4.1",
60
- "@google-cloud/storage": "^7.10.1",
61
- "@storybook/addon-actions": "^8.0.9",
62
- "@storybook/addon-essentials": "^8.0.9",
63
- "@storybook/addon-interactions": "^8.0.9",
64
- "@storybook/addon-links": "^8.0.9",
60
+ "@google-cloud/storage": "^7.11.0",
61
+ "@storybook/addon-actions": "^8.0.10",
62
+ "@storybook/addon-essentials": "^8.0.10",
63
+ "@storybook/addon-interactions": "^8.0.10",
64
+ "@storybook/addon-links": "^8.0.10",
65
65
  "@storybook/addon-webpack5-compiler-swc": "^1.0.2",
66
- "@storybook/blocks": "^8.0.9",
67
- "@storybook/react": "^8.0.9",
68
- "@storybook/react-webpack5": "^8.0.9",
69
- "@storybook/theming": "^8.0.9",
70
- "@testing-library/dom": "^10.0.0",
71
- "@testing-library/jest-dom": "^6.4.2",
72
- "@testing-library/react": "^15.0.3",
66
+ "@storybook/blocks": "^8.0.10",
67
+ "@storybook/react": "^8.0.10",
68
+ "@storybook/react-webpack5": "^8.0.10",
69
+ "@storybook/theming": "^8.0.10",
70
+ "@testing-library/dom": "^10.1.0",
71
+ "@testing-library/jest-dom": "^6.4.5",
72
+ "@testing-library/react": "^15.0.6",
73
73
  "@testing-library/user-event": "^14.5.2",
74
74
  "@types/jest": "^29.5.12",
75
75
  "@types/luxon": "^3.4.2",
76
- "@types/react": "^18.2.79",
77
- "@types/react-dom": "^18.2.25",
78
- "@typescript-eslint/eslint-plugin": "^7.7.1",
79
- "@typescript-eslint/parser": "^7.7.1",
76
+ "@types/react": "^18.3.1",
77
+ "@types/react-dom": "^18.3.0",
78
+ "@typescript-eslint/eslint-plugin": "^7.8.0",
79
+ "@typescript-eslint/parser": "^7.8.0",
80
80
  "axios": "^1.6.8",
81
81
  "eslint": "^8.57.0",
82
82
  "glob": "^10.3.12",
@@ -84,9 +84,9 @@
84
84
  "jest-environment-jsdom": "^29.7.0",
85
85
  "jsdom": "^24.0.0",
86
86
  "prettier": "^3.2.5",
87
- "react-hook-form": "^7.51.3",
88
- "release-it": "^17.2.0",
89
- "storybook": "^8.0.9",
87
+ "react-hook-form": "^7.51.4",
88
+ "release-it": "^17.2.1",
89
+ "storybook": "^8.0.10",
90
90
  "ts-jest": "^29.1.2",
91
91
  "typescript": "^5.4.5"
92
92
  },
@@ -20,9 +20,4 @@ const Avatar = forwardRef<AvatarProps, 'span'>((props, ref) => (
20
20
  <ChakraAvatar getInitials={getInitials} {...props} ref={ref} />
21
21
  ));
22
22
 
23
- Avatar.defaultProps = {
24
- borderRadius: '8',
25
- size: '32',
26
- } as AvatarProps;
27
-
28
23
  export default Avatar;
@@ -5,6 +5,8 @@ const BadgeTheme = {
5
5
  paddingX: '8',
6
6
  paddingY: '4',
7
7
  textStyle: 'comp/badge/sm',
8
+ color: 'text/on-color',
9
+ backgroundColor: 'sys/primary/base',
8
10
  },
9
11
  };
10
12
 
@@ -7,9 +7,4 @@ export type BadgeProps = ChakraBadgeProps;
7
7
  */
8
8
  const Badge = forwardRef<BadgeProps, 'span'>((props, ref) => <ChakraBadge {...props} ref={ref} />);
9
9
 
10
- Badge.defaultProps = {
11
- backgroundColor: 'purple.40',
12
- color: 'neutral.100',
13
- } as BadgeProps;
14
-
15
10
  export default Badge;
@@ -15,7 +15,16 @@ export interface ButtonProps extends ChakraButtonProps {
15
15
  * The Button component is used to trigger an action or event, such as submitting a form, opening a dialog, canceling an action, or performing a delete operation.
16
16
  */
17
17
  const Button = forwardRef<ButtonProps, 'button'>((props, ref) => {
18
- const { as, isDanger, isDisabled, leftIconName, rightIconName, size = 'lg', variant, ...rest } = props;
18
+ const {
19
+ as = 'button',
20
+ isDanger,
21
+ isDisabled,
22
+ leftIconName,
23
+ rightIconName,
24
+ size = 'lg',
25
+ variant = 'primary',
26
+ ...rest
27
+ } = props;
19
28
  const properties: ChakraButtonProps = {
20
29
  as: isDisabled ? 'button' : as,
21
30
  isDisabled,
@@ -34,10 +43,4 @@ const Button = forwardRef<ButtonProps, 'button'>((props, ref) => {
34
43
  return <ChakraButton {...properties} ref={ref} />;
35
44
  });
36
45
 
37
- Button.defaultProps = {
38
- as: 'button',
39
- size: 'lg',
40
- variant: 'primary',
41
- } as ButtonProps;
42
-
43
46
  export default Button;
@@ -11,7 +11,7 @@ export interface CardProps extends BoxProps {
11
11
  * Basic container element with default box shadow and border radius.
12
12
  */
13
13
  const Card = forwardRef<CardProps, 'div'>((props, ref) => {
14
- const { as, variant, withHover, ...rest } = props;
14
+ const { as = 'div', variant = 'elevated', withHover, ...rest } = props;
15
15
  const css = useStyleConfig('Card', { as, variant, withHover });
16
16
 
17
17
  const properties = {
@@ -24,9 +24,4 @@ const Card = forwardRef<CardProps, 'div'>((props, ref) => {
24
24
  return <Box __css={css} {...properties} ref={ref} />;
25
25
  });
26
26
 
27
- Card.defaultProps = {
28
- as: 'div',
29
- variant: 'elevated',
30
- } as CardProps;
31
-
32
27
  export default Card;
@@ -34,8 +34,4 @@ const CodeBlock = ({ children, isCopiable, ...props }: CodeBlockProps) => {
34
34
  );
35
35
  };
36
36
 
37
- CodeBlock.defaultProps = {
38
- size: 'lg',
39
- } as CodeBlockProps;
40
-
41
37
  export default CodeBlock;
@@ -34,8 +34,4 @@ const CodeSnippet = (props: CodeSnippetProps) => {
34
34
  );
35
35
  };
36
36
 
37
- CodeSnippet.defaultProps = {
38
- size: 'lg',
39
- } as CodeSnippetProps;
40
-
41
37
  export default CodeSnippet;
@@ -10,7 +10,7 @@ export interface ColorButtonProps extends ChakraButtonProps {
10
10
  * The ColorButton component is used to trigger an action or event, such as submitting a form, opening a dialog, canceling an action, or performing a delete operation.
11
11
  */
12
12
  const ColorButton = forwardRef<ColorButtonProps, 'button'>((props, ref) => {
13
- const { as, colorScheme, isDisabled, isLoading, ...rest } = props;
13
+ const { as = 'button', colorScheme, isDisabled, isLoading, ...rest } = props;
14
14
  const styles = {
15
15
  ...useStyleConfig('Button', { size: 'sm' }),
16
16
  ...useStyleConfig('ColorButton', { colorScheme }),
@@ -29,8 +29,4 @@ const ColorButton = forwardRef<ColorButtonProps, 'button'>((props, ref) => {
29
29
  return <ChakraButton {...properties} ref={ref} size="sm" />;
30
30
  });
31
31
 
32
- ColorButton.defaultProps = {
33
- as: 'button',
34
- } as ColorButtonProps;
35
-
36
32
  export default ColorButton;
@@ -34,16 +34,16 @@ export interface DialogProps
34
34
  const Dialog: ComponentWithAs<'section', DialogProps> = ({
35
35
  children,
36
36
  closeNotice,
37
- isClosable,
37
+ isClosable = true,
38
38
  isOpen,
39
39
  onClose,
40
40
  onCloseComplete,
41
41
  returnFocusOnClose = true,
42
- scrollBehavior,
43
- size,
42
+ scrollBehavior = 'outside',
43
+ size = 'medium',
44
44
  title,
45
- trapFocus,
46
- variant,
45
+ trapFocus = true,
46
+ variant = 'default',
47
47
  ...rest
48
48
  }: DialogProps) => {
49
49
  const dialogSize = useBreakpointValue({ [BREAKPOINTS.MOBILE]: 'mobile', [BREAKPOINTS.TABLET]: size });
@@ -93,12 +93,4 @@ const Dialog: ComponentWithAs<'section', DialogProps> = ({
93
93
  );
94
94
  };
95
95
 
96
- Dialog.defaultProps = {
97
- isClosable: true,
98
- scrollBehavior: 'outside',
99
- size: 'medium',
100
- trapFocus: true,
101
- variant: 'default',
102
- } as DialogProps;
103
-
104
96
  export default Dialog;
@@ -1,7 +1,7 @@
1
1
  import { Divider as ChakraDivider, DividerProps as ChakraDividerProps } from '@chakra-ui/react';
2
2
 
3
3
  export interface DividerProps extends ChakraDividerProps {
4
- orientation: 'horizontal' | 'vertical';
4
+ orientation?: 'horizontal' | 'vertical';
5
5
  size?: '1' | '2';
6
6
  variant?: 'dashed' | 'dotted' | 'solid';
7
7
  }
@@ -11,21 +11,19 @@ export interface DividerProps extends ChakraDividerProps {
11
11
  */
12
12
  const Divider = (props: DividerProps) => {
13
13
  const { orientation, size, ...rest } = props;
14
- const properties: ChakraDividerProps = { ...rest, orientation };
14
+ const properties: ChakraDividerProps = {
15
+ color: 'separator.primary',
16
+ orientation: orientation || 'horizontal',
17
+ size: size || '1',
18
+ variant: 'solid',
19
+ ...rest,
20
+ };
15
21
  if (orientation === 'horizontal') {
16
22
  properties.borderBottomWidth = `${size}px`;
17
23
  } else {
18
24
  properties.borderLeftWidth = `${size}px`;
19
25
  }
20
- return <ChakraDivider {...properties} />;
26
+ return <ChakraDivider as="hr" {...properties} />;
21
27
  };
22
28
 
23
- Divider.defaultProps = {
24
- as: 'hr',
25
- color: 'separator.primary',
26
- orientation: 'horizontal',
27
- size: '1',
28
- variant: 'solid',
29
- } as DividerProps;
30
-
31
29
  export default Divider;
@@ -271,7 +271,7 @@ const Dropdown = forwardRef<Element, DropdownProps<string | null>>(
271
271
  readOnly,
272
272
  returnFocus = true,
273
273
  search,
274
- size,
274
+ size = 'lg',
275
275
  value,
276
276
  ...props
277
277
  },
@@ -381,10 +381,6 @@ const Dropdown = forwardRef<Element, DropdownProps<string | null>>(
381
381
  },
382
382
  );
383
383
 
384
- Dropdown.defaultProps = {
385
- size: 'lg',
386
- } as DropdownProps<string | null>;
387
-
388
384
  export function typedDropdown<T>() {
389
385
  return {
390
386
  Dropdown: Dropdown as React.ForwardRefExoticComponent<DropdownProps<T> & React.RefAttributes<Element>>,
@@ -31,7 +31,7 @@ const FileInput = forwardRef<FileInputProps, 'div'>((props, ref) => {
31
31
  isDisabled,
32
32
  isInvalid,
33
33
  isRequired,
34
- label,
34
+ label = 'Drag and drop file here or click to select',
35
35
  name,
36
36
  onChange,
37
37
  ...rest
@@ -147,8 +147,4 @@ const FileInput = forwardRef<FileInputProps, 'div'>((props, ref) => {
147
147
  );
148
148
  });
149
149
 
150
- FileInput.defaultProps = {
151
- label: 'Drag and drop file here or click to select',
152
- };
153
-
154
150
  export default FileInput;
@@ -21,17 +21,17 @@ export interface IconButtonProps extends ChakraIconButtonProps {
21
21
  */
22
22
  const IconButton = forwardRef<IconButtonProps, 'button'>((props, ref) => {
23
23
  const {
24
- as,
24
+ as = 'button',
25
25
  iconName,
26
26
  iconSize,
27
27
  isDanger,
28
28
  isDisabled,
29
29
  isTooltipDisabled,
30
30
  label,
31
- size,
32
- tooltipCloseDelay,
31
+ size = 'lg',
32
+ tooltipCloseDelay = 0,
33
33
  tooltipProps,
34
- variant,
34
+ variant = 'primary',
35
35
  ...rest
36
36
  } = props;
37
37
  const properties: ChakraIconButtonProps = {
@@ -55,11 +55,4 @@ const IconButton = forwardRef<IconButtonProps, 'button'>((props, ref) => {
55
55
  );
56
56
  });
57
57
 
58
- IconButton.defaultProps = {
59
- as: 'button',
60
- size: 'lg',
61
- tooltipCloseDelay: 0,
62
- variant: 'primary',
63
- } as IconButtonProps;
64
-
65
58
  export default IconButton;
@@ -15,7 +15,7 @@ export interface LightBoxProps extends Omit<HTMLChakraProps<'section'>, 'scrollB
15
15
  onClose(): void;
16
16
  }
17
17
 
18
- const LightBox = ({ children, dataTestid, isOpen, onClose, size, ...rest }: LightBoxProps) => {
18
+ const LightBox = ({ children, dataTestid, isOpen, onClose, size = 'large', ...rest }: LightBoxProps) => {
19
19
  const prefersReducedMotion = usePrefersReducedMotion({ ssr: false });
20
20
  const dialogSize = useBreakpointValue({ [BREAKPOINTS.MOBILE]: 'mobile', [BREAKPOINTS.TABLET]: size });
21
21
 
@@ -29,8 +29,4 @@ const LightBox = ({ children, dataTestid, isOpen, onClose, size, ...rest }: Ligh
29
29
  );
30
30
  };
31
31
 
32
- LightBox.defaultProps = {
33
- size: 'large',
34
- } as LightBoxProps;
35
-
36
32
  export default LightBox;
@@ -12,7 +12,7 @@ export interface LinkProps extends ChakraLinkProps {
12
12
  * Links are accessible elements used primarily for navigation.
13
13
  */
14
14
  const Link = forwardRef<LinkProps, 'a'>((props, ref) => {
15
- const { as, isUnderlined, ...rest } = props;
15
+ const { as = 'a', isUnderlined, ...rest } = props;
16
16
  const properties: ChakraLinkProps = { as, ...rest };
17
17
  if (isUnderlined) {
18
18
  properties.textDecoration = 'underline';
@@ -20,12 +20,7 @@ const Link = forwardRef<LinkProps, 'a'>((props, ref) => {
20
20
  if (as === 'button') {
21
21
  properties.type = 'button';
22
22
  }
23
- return <ChakraLink {...properties} ref={ref} />;
23
+ return <ChakraLink as={as} {...properties} ref={ref} />;
24
24
  });
25
25
 
26
- Link.defaultProps = {
27
- as: 'a',
28
- isUnderlined: false,
29
- } as LinkProps;
30
-
31
26
  export default Link;
@@ -8,13 +8,9 @@ export interface ListProps extends ChakraListProps {
8
8
  * List is used to display list items. It renders a <ul> or <ol> element by default.
9
9
  */
10
10
  const List = forwardRef<ListProps, 'ul'>((props, ref) => {
11
- const { isOrdered, ...rest } = props;
11
+ const { isOrdered, spacing = '8', ...rest } = props;
12
12
  const Component = isOrdered ? OrderedList : UnorderedList;
13
- return <Component {...rest} ref={ref} />;
13
+ return <Component spacing={spacing} {...rest} ref={ref} />;
14
14
  });
15
15
 
16
- List.defaultProps = {
17
- spacing: '8',
18
- };
19
-
20
16
  export default List;
@@ -12,7 +12,7 @@ export interface OverflowMenuProps extends MenuProps {
12
12
  withPortal?: boolean;
13
13
  }
14
14
 
15
- const OverflowMenu = ({ buttonSize = 'sm', children, triggerLabel, withPortal }: OverflowMenuProps) => {
15
+ const OverflowMenu = ({ buttonSize = 'sm', children, triggerLabel = 'Open menu', withPortal }: OverflowMenuProps) => {
16
16
  const Wrapper = withPortal ? Portal : Fragment;
17
17
  return (
18
18
  <Menu isLazy>
@@ -31,9 +31,4 @@ const OverflowMenu = ({ buttonSize = 'sm', children, triggerLabel, withPortal }:
31
31
  );
32
32
  };
33
33
 
34
- OverflowMenu.defaultProps = {
35
- triggerLabel: 'Open menu',
36
- withPortal: false,
37
- };
38
-
39
34
  export default OverflowMenu;
@@ -8,11 +8,12 @@ export interface PopoverProps extends ChakraPopoverProps {
8
8
  }
9
9
 
10
10
  const Popover = (props: PopoverProps) => {
11
- const { withArrow, ...rest } = props;
11
+ const { variant = 'light', withArrow, ...rest } = props;
12
12
  const popoverProps = {
13
13
  arrowPadding: 16,
14
14
  arrowSize: 16,
15
15
  gutter: withArrow ? 16 : 8,
16
+ variant,
16
17
  ...rest,
17
18
  };
18
19
  const ctx = useMemo<PopoverContextType>(
@@ -29,8 +30,4 @@ const Popover = (props: PopoverProps) => {
29
30
  );
30
31
  };
31
32
 
32
- Popover.defaultProps = {
33
- variant: 'light',
34
- };
35
-
36
33
  export default Popover;
@@ -25,27 +25,35 @@ export interface TagProps extends Omit<ChakraTagProps, 'colorScheme' | 'size' |
25
25
  }
26
26
 
27
27
  const Tag = forwardRef<TagProps, 'span'>((props, ref) => {
28
- const { children, closeButtonTooltip, iconColor, iconName, isDisabled, isLoading, onClose, withIcon, ...tagProps } =
29
- props;
28
+ const {
29
+ children,
30
+ closeButtonTooltip,
31
+ colorScheme = 'neutral',
32
+ iconColor,
33
+ iconName,
34
+ isDisabled,
35
+ isLoading,
36
+ onClose,
37
+ size = 'md',
38
+ withIcon,
39
+ ...tagProps
40
+ } = props;
30
41
  const style = useMultiStyleConfig('Tag', props);
31
42
 
32
43
  return (
33
44
  <ChakraTag
34
45
  aria-busy={isLoading}
35
46
  aria-disabled={isDisabled}
47
+ colorScheme={colorScheme}
36
48
  data-disabled={isDisabled || undefined}
37
49
  data-loading={isLoading || undefined}
50
+ size={size}
38
51
  sx={style.container}
39
52
  {...tagProps}
40
53
  ref={ref}
41
54
  >
42
55
  {(withIcon || !!iconName) && (
43
- <Icon
44
- __css={style.icon}
45
- color={iconColor}
46
- name={iconName || 'Tick'}
47
- size={tagProps.size === 'sm' ? '16' : '24'}
48
- />
56
+ <Icon __css={style.icon} color={iconColor} name={iconName || 'Tick'} size={size === 'sm' ? '16' : '24'} />
49
57
  )}
50
58
  <Text as="span" hasEllipsis sx={style.label}>
51
59
  {isLoading ? (
@@ -67,9 +75,4 @@ const Tag = forwardRef<TagProps, 'span'>((props, ref) => {
67
75
  );
68
76
  });
69
77
 
70
- Tag.defaultProps = {
71
- colorScheme: 'neutral',
72
- size: 'md',
73
- } as TagProps;
74
-
75
78
  export default Tag;
@@ -10,8 +10,8 @@ export interface TextProps extends ChakraTextProps {
10
10
  * `Text` component is the used to render text and paragraphs within an interface. It renders a `<p>` tag by default.
11
11
  */
12
12
  const Text = forwardRef<TextProps, 'p'>((props, ref) => {
13
- const { hasEllipsis, size, ...rest } = props;
14
- const properties: ChakraTextProps = { size, ...rest };
13
+ const { hasEllipsis, ...rest } = props;
14
+ const properties: ChakraTextProps = { ...rest };
15
15
 
16
16
  if (hasEllipsis) {
17
17
  if (!properties.maxWidth) {
@@ -21,11 +21,7 @@ const Text = forwardRef<TextProps, 'p'>((props, ref) => {
21
21
  properties.whiteSpace = 'nowrap';
22
22
  properties.overflow = 'hidden';
23
23
  }
24
- return <ChakraText {...properties} ref={ref} />;
24
+ return <ChakraText as="p" {...properties} ref={ref} />;
25
25
  });
26
26
 
27
- Text.defaultProps = {
28
- as: 'p',
29
- } as TextProps;
30
-
31
27
  export default Text;
@@ -1,11 +0,0 @@
1
- /* eslint-disable */
2
-
3
- export const sortObjectByKey = (unordered: any) => {
4
- return Object.keys(unordered)
5
- .sort()
6
- .reduce((obj, key) => {
7
- /* @ts-ignore */
8
- obj[key] = unordered[key];
9
- return obj;
10
- }, {});
11
- };