@bitrise/bitkit 13.359.0 → 13.361.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.359.0",
4
+ "version": "13.361.0",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+ssh://git@github.com/bitrise-io/bitkit.git"
@@ -38,7 +38,7 @@
38
38
  "chakra-ui-2--theme": "npm:@chakra-ui/theme@3.4.9",
39
39
  "chakra-ui-2--theme-tools": "npm:@chakra-ui/theme-tools@2.2.9",
40
40
  "clsx": "^2.1.1",
41
- "framer-motion": "^12.38.0",
41
+ "framer-motion": "^12.42.2",
42
42
  "luxon": "^3.7.2",
43
43
  "react": "^18.3.1",
44
44
  "react-dom": "^18.3.1",
@@ -51,12 +51,12 @@
51
51
  "react-dom": "^18.2.0"
52
52
  },
53
53
  "devDependencies": {
54
- "@babel/core": "^7.29.0",
55
- "@babel/preset-env": "^7.29.5",
56
- "@babel/preset-react": "^7.28.5",
57
- "@babel/preset-typescript": "^7.28.5",
54
+ "@babel/core": "^7.29.7",
55
+ "@babel/preset-env": "^7.29.7",
56
+ "@babel/preset-react": "^7.29.7",
57
+ "@babel/preset-typescript": "^7.29.7",
58
58
  "@bitrise/eslint-plugin": "^4.1.0",
59
- "@google-cloud/storage": "^7.19.0",
59
+ "@google-cloud/storage": "^7.21.0",
60
60
  "@storybook/addon-docs": "^9.1.20",
61
61
  "@storybook/addon-links": "^9.1.20",
62
62
  "@storybook/addon-webpack5-compiler-swc": "^3.0.0",
@@ -66,10 +66,10 @@
66
66
  "@testing-library/react": "16.3.2",
67
67
  "@testing-library/user-event": "^14.6.1",
68
68
  "@types/jest": "^29.5.14",
69
- "@types/luxon": "^3.7.1",
70
- "@types/react": "^18.3.28",
69
+ "@types/luxon": "^3.7.2",
70
+ "@types/react": "^18.3.31",
71
71
  "@types/react-dom": "^18.3.7",
72
- "axios": "^1.16.1",
72
+ "axios": "^1.18.1",
73
73
  "chakra-ui-2--cli": "npm:@chakra-ui/cli@2.5.8",
74
74
  "eslint": "^9.39.4",
75
75
  "glob": "^11.1.0",
@@ -77,11 +77,11 @@
77
77
  "jest-environment-jsdom": "^29.7.0",
78
78
  "jsdom": "26.1.0",
79
79
  "lodash": "^4.18.1",
80
- "prettier": "^3.8.3",
81
- "react-hook-form": "^7.76.0",
80
+ "prettier": "^3.9.4",
81
+ "react-hook-form": "^7.81.0",
82
82
  "release-it": "^19.2.4",
83
83
  "storybook": "^9.1.20",
84
- "ts-jest": "^29.4.9",
84
+ "ts-jest": "^29.4.11",
85
85
  "typescript": "^5.9.3"
86
86
  },
87
87
  "files": [
@@ -4,14 +4,7 @@ import Icon, { TypeIconName } from '../Icon/Icon';
4
4
  import Text from '../Text/Text';
5
5
 
6
6
  export type BadgeColorScheme =
7
- | 'neutral'
8
- | 'info'
9
- | 'positive'
10
- | 'negative'
11
- | 'warning'
12
- | 'progress'
13
- | 'orange'
14
- | 'turquoise';
7
+ 'neutral' | 'info' | 'positive' | 'negative' | 'warning' | 'progress' | 'orange' | 'turquoise';
15
8
 
16
9
  export interface BadgeProps extends ChakraBadgeProps {
17
10
  children?: string | number;
@@ -1,14 +1,7 @@
1
1
  import { forwardRef, List as ChakraList, ListProps as ChakraListProps } from 'chakra-ui-2--react';
2
2
 
3
3
  export type ListColorsType =
4
- | 'neutral'
5
- | 'info'
6
- | 'positive'
7
- | 'negative'
8
- | 'warning'
9
- | 'progress'
10
- | 'orange'
11
- | 'turquoise';
4
+ 'neutral' | 'info' | 'positive' | 'negative' | 'warning' | 'progress' | 'orange' | 'turquoise';
12
5
 
13
6
  export type ListProps = (
14
7
  | {
@@ -8,6 +8,7 @@ import Link from '../Link/Link';
8
8
  import List from '../List/List';
9
9
  import ListItem from '../List/ListItem';
10
10
  import Text from '../Text/Text';
11
+ import codeBlockText from './codeBlockText';
11
12
 
12
13
  type GapType = Exclude<BoxProps['gap'], undefined>;
13
14
 
@@ -44,9 +45,10 @@ const defaultComponents = (size: 'sm' | 'md' | 'lg', gap: GapType = '16'): Compo
44
45
  li: ({ node: _, ...props }) => <ListItem {...props} />,
45
46
  ol: ({ node: _, ...props }) => <List variant="simple-ordered" {...props} />,
46
47
  p: ({ node: _, ...props }) => <Text {...props} />,
47
- pre: ({ node: _, ...props }) => (
48
+ // The parser closes a code block with a newline, which would render as an empty last line.
49
+ pre: ({ node: _, children }) => (
48
50
  <CodeSnippet variant="multi" size={codeSize}>
49
- {props.children as string}
51
+ {codeBlockText(children).replace(/\n$/, '')}
50
52
  </CodeSnippet>
51
53
  ),
52
54
  ul: ({ node: _, ...props }) => <List {...props} />,
@@ -0,0 +1,22 @@
1
+ import { Children, isValidElement, ReactNode } from 'react';
2
+
3
+ /**
4
+ * Collects the text of a markdown code block.
5
+ *
6
+ * A fenced code block arrives as `<pre><code>…</code></pre>`, so the nested `<code>` would also go
7
+ * through the `code` component of MarkdownContent and wrap the block in an inline CodeSnippet.
8
+ * Passing the text instead keeps the block a single element, and it is what CodeSnippet's copy
9
+ * button puts on the clipboard.
10
+ *
11
+ * Note that this flattens any markup inside the block, so a rehype plugin that decorates code
12
+ * (syntax highlighting, for instance) contributes its text but not its elements.
13
+ */
14
+ export const codeBlockText = (children: ReactNode): string =>
15
+ // Children.toArray already drops null, undefined and booleans.
16
+ Children.toArray(children)
17
+ .map((child) =>
18
+ isValidElement<{ children?: ReactNode }>(child) ? codeBlockText(child.props.children) : String(child),
19
+ )
20
+ .join('');
21
+
22
+ export default codeBlockText;
@@ -23,115 +23,113 @@ const getGradient = (position: 'left' | 'right', variant: 'contained' | 'line')
23
23
  return style;
24
24
  };
25
25
 
26
- const baseStyle = defineStyle(
27
- ({ variant }): SystemStyleObject => ({
28
- containedTab: {
29
- _first: {
30
- _focusVisible: {
31
- boxShadow: 'inset 0 2px var(--colors-purple-50), inset 0 0 0 3px var(--colors-purple-70)',
32
- },
33
- boxShadow: 'none',
34
- },
26
+ const baseStyle = defineStyle(({ variant }): SystemStyleObject => ({
27
+ containedTab: {
28
+ _first: {
35
29
  _focusVisible: {
36
30
  boxShadow: 'inset 0 2px var(--colors-purple-50), inset 0 0 0 3px var(--colors-purple-70)',
37
31
  },
38
- _hover: {
39
- backgroundColor: 'background/active',
40
- },
41
- _disabled: {
42
- backgroundColor: 'neutral.90',
43
- color: 'neutral.70',
44
- cursor: 'not-allowed',
32
+ boxShadow: 'none',
33
+ },
34
+ _focusVisible: {
35
+ boxShadow: 'inset 0 2px var(--colors-purple-50), inset 0 0 0 3px var(--colors-purple-70)',
36
+ },
37
+ _hover: {
38
+ backgroundColor: 'background/active',
39
+ },
40
+ _disabled: {
41
+ backgroundColor: 'neutral.90',
42
+ color: 'neutral.70',
43
+ cursor: 'not-allowed',
44
+ },
45
+ _selected: {
46
+ '+ [role="tab"]': {
47
+ boxShadow: 'none',
45
48
  },
46
- _selected: {
47
- '+ [role="tab"]': {
48
- boxShadow: 'none',
49
- },
50
- _first: {
51
- boxShadow: 'inset 0 2px var(--colors-purple-50)',
52
- },
53
- _hover: {
54
- backgroundColor: 'neutral.100',
55
- },
56
- backgroundColor: 'neutral.100',
57
- borderRight: 0,
49
+ _first: {
58
50
  boxShadow: 'inset 0 2px var(--colors-purple-50)',
59
- div: {
60
- color: 'purple.50',
61
- },
62
51
  },
63
- backgroundColor: 'neutral.93',
64
- boxShadow: 'inset 1px 0 0 var(--colors-neutral-80)',
65
- color: 'neutral.40',
66
- alignContent: 'center',
67
- paddingX: '16',
68
- paddingY: '12',
69
- textAlign: 'left',
70
- whiteSpace: 'nowrap',
71
- },
72
- lineTab: {
73
52
  _hover: {
74
- backgroundColor: 'background/secondary',
75
- },
76
- _active: {
77
- backgroundColor: 'neutral.93',
78
- },
79
- _disabled: {
80
- background: 'transparent',
81
- color: 'neutral.70',
82
- cursor: 'not-allowed',
83
- },
84
- _focusVisible: {
85
- boxShadow: 'inset 0 -2px var(--colors-purple-50), inset 0 0 0 3px var(--colors-purple-70)',
53
+ backgroundColor: 'neutral.100',
86
54
  },
87
- _selected: {
88
- _hover: {
89
- backgroundColor: 'transparent',
90
- },
91
- boxShadow: 'inset 0 -2px var(--colors-purple-50)',
55
+ backgroundColor: 'neutral.100',
56
+ borderRight: 0,
57
+ boxShadow: 'inset 0 2px var(--colors-purple-50)',
58
+ div: {
92
59
  color: 'purple.50',
93
60
  },
94
- alignItems: 'center',
95
- color: 'neutral.50',
96
- display: 'flex',
97
- gap: '8',
98
- justifyContent: 'flex-start',
99
- paddingX: '16',
100
- paddingY: '12',
101
- textStyle: 'comp/tabs/line',
102
- whiteSpace: 'nowrap',
103
61
  },
104
- tablist: {
105
- borderBottom: variant === 'line' ? '1px solid' : undefined,
106
- borderBottomColor: variant === 'line' ? 'separator.primary' : undefined,
107
- maxWidth: '100%',
108
- overflowY: 'hidden',
109
- overflowX: 'scroll',
110
- scrollbarWidth: 'none',
111
- '::-webkit-scrollbar': {
112
- width: 0,
113
- },
62
+ backgroundColor: 'neutral.93',
63
+ boxShadow: 'inset 1px 0 0 var(--colors-neutral-80)',
64
+ color: 'neutral.40',
65
+ alignContent: 'center',
66
+ paddingX: '16',
67
+ paddingY: '12',
68
+ textAlign: 'left',
69
+ whiteSpace: 'nowrap',
70
+ },
71
+ lineTab: {
72
+ _hover: {
73
+ backgroundColor: 'background/secondary',
114
74
  },
115
- tabpanel: {
116
- _focusVisible: {
117
- boxShadow: 'none',
75
+ _active: {
76
+ backgroundColor: 'neutral.93',
77
+ },
78
+ _disabled: {
79
+ background: 'transparent',
80
+ color: 'neutral.70',
81
+ cursor: 'not-allowed',
82
+ },
83
+ _focusVisible: {
84
+ boxShadow: 'inset 0 -2px var(--colors-purple-50), inset 0 0 0 3px var(--colors-purple-70)',
85
+ },
86
+ _selected: {
87
+ _hover: {
88
+ backgroundColor: 'transparent',
118
89
  },
90
+ boxShadow: 'inset 0 -2px var(--colors-purple-50)',
91
+ color: 'purple.50',
119
92
  },
120
- arrowButton: {
121
- width: variant === 'line' ? '48' : rem(68),
122
- height: variant === 'line' ? '48' : rem(68),
123
- borderRadius: 0,
124
- backgroundColor: variant === 'line' ? 'background/primary' : 'background/tertiary',
125
- flexShrink: 0,
126
- color: 'icon/primary',
127
- paddingY: '12',
128
- paddingX: '16',
129
- position: 'absolute',
130
- top: '0',
93
+ alignItems: 'center',
94
+ color: 'neutral.50',
95
+ display: 'flex',
96
+ gap: '8',
97
+ justifyContent: 'flex-start',
98
+ paddingX: '16',
99
+ paddingY: '12',
100
+ textStyle: 'comp/tabs/line',
101
+ whiteSpace: 'nowrap',
102
+ },
103
+ tablist: {
104
+ borderBottom: variant === 'line' ? '1px solid' : undefined,
105
+ borderBottomColor: variant === 'line' ? 'separator.primary' : undefined,
106
+ maxWidth: '100%',
107
+ overflowY: 'hidden',
108
+ overflowX: 'scroll',
109
+ scrollbarWidth: 'none',
110
+ '::-webkit-scrollbar': {
111
+ width: 0,
131
112
  },
132
- arrowButtonGradient: ((position: 'left' | 'right') => getGradient(position, variant)) as any,
133
- }),
134
- );
113
+ },
114
+ tabpanel: {
115
+ _focusVisible: {
116
+ boxShadow: 'none',
117
+ },
118
+ },
119
+ arrowButton: {
120
+ width: variant === 'line' ? '48' : rem(68),
121
+ height: variant === 'line' ? '48' : rem(68),
122
+ borderRadius: 0,
123
+ backgroundColor: variant === 'line' ? 'background/primary' : 'background/tertiary',
124
+ flexShrink: 0,
125
+ color: 'icon/primary',
126
+ paddingY: '12',
127
+ paddingX: '16',
128
+ position: 'absolute',
129
+ top: '0',
130
+ },
131
+ arrowButtonGradient: ((position: 'left' | 'right') => getGradient(position, variant)) as any,
132
+ }));
135
133
 
136
134
  const TabsTheme = defineStyleConfig({
137
135
  baseStyle,